Fix PostgreSQL visual query follow-ups - #588
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous Review Summary (commit e0c4eaf)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit e0c4eaf)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by glm-5.2 · Input: 70K · Output: 10.3K · Cached: 160.5K |
|
Hi @DhruvShah-Dev can you fix merge conflicts? |
|
Resolved the merge conflicts with current main and pushed commit 53a60ac. Verified with pnpm.cmd exec vitest run tests/utils/visualQuery.test.ts (66 passed). |
|
Hey @DhruvShah-Dev, thanks for working on these PostgreSQL follow-ups. I tested the PR locally and found a blocker around HAVING generation.
PostgreSQL rejects both forms. There is also a new test that expects this query fragment: SELECT COUNT(t1."AccountId") AS "Total Count"
FROM "AccountEventLog" t1
HAVING t1."AccountId" > 0I ran it against PostgreSQL 16, and it fails because Could you update the HAVING formatting so it preserves aggregate expressions and add PostgreSQL test cases for Everything else looks good. I ran the full frontend suite with 3,715 passing tests, plus typecheck and lint. CI is also green. |
|
Thanks for this, @DhruvShah-Dev — the HAVING-quoting and SELECT-alias-quoting fixes here are catching real, separate bugs (mixed-case/reserved-word columns and aliases render unquoted today, even for the plain builtin Heads up on one overlap to be aware of before this merges:
The difference matters beyond just merge mechanics: the hardcoded-id version only works because the current PostgreSQL plugin happens to be registered as Confirmed via a throwaway test-merge that the actual conflict is small and contained to @debba — flagging for you to decide how to resolve (merge order, which version of |
|
Thanks for the detailed analysis @aesslinger, and for running the test-merge to size up the conflict. I'd go ahead and merge #588 first. The HAVING and alias quoting functions it adds are net-new and fix real bugs users can hit today, so I'd rather preserve that additive work and land it now instead of holding it behind the bigger migration PR. @aesslinger since you already scoped the overlap, can you take care of resolving the conflict on #577 after this lands? The @DhruvShah-Dev thanks again for the fix, merging shortly. |
…ration Resolves the shouldQuoteIdentifiers/visualQuery.ts conflict with TabularisDB#588 per debba's instructions on that PR: keep the sql_dialect-based capability check as the primary path, but widen the literal-string fallback to also cover "postgresql" so TabularisDB#588's original driver-id fix isn't lost when no manifest is in scope. Also widens formatAggregateArgument/formatHavingColumnRef/ formatAlias/generateHavingClause (all new in TabularisDB#588) to the shared DriverArg type so they inherit the same capability-driven quoting, verified against a postgres-dialect plugin manifest producing byte-identical HAVING-clause output to the bare "postgres" string.
Summary
Testing