fix(editor): quote PostgreSQL table completion identifiers - #791
fix(editor): quote PostgreSQL table completion identifiers#791mikevillari wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
I need your local test results regarding the following points:
|
|
Verified locally against a real PostgreSQL 18.4 process, using the exact PR head Results: 36 autocomplete-generated queries passed, plus 21 control queries with the expected outcomes. I created each of these in
The important distinction in point 1 is how the table was created: unquoted Example queries actually generated and executed: SELECT marker FROM "lowercase_table";
SELECT marker FROM "uppercase_table";
SELECT marker FROM public."MixedCaseTable";
SELECT marker FROM "authschema"."MixedCaseTable";
SELECT marker FROM "AuthSchema"."QUOTED_UPPER_TABLE";For both Method: create isolated fixture tables containing distinct marker rows; read their names from Server reported: |
PostgreSQL table suggestions currently insert catalog names verbatim, so accepting
My_Schema_With_Caps.My_Table_With_Capsproduces unquoted SQL that PostgreSQL folds to lowercase. This also reproduces with the completion provider from before #715 (base 4c5f657).Follow-up to @nktnet1's report in #705: #705 (comment).
Pass the editor's existing connection dialect into the completion provider and use the shared identifier quoter for PostgreSQL table-name components. Keep labels/filtering separate from inserted SQL, preserve qualified replacement ranges and bare-label fallback, and recognize quoted table names when offering columns after a dot. Re-register when the connection dialect changes. Other dialects keep their existing table insertion behavior.
Tests assert applied edits for mixed-case schema/table names, typed qualifiers, dot-triggered suggestions, bare labels, embedded quotes, spaces, reserved words and lowercase names; they also cover quoted column lookup and dialect changes in the editor.
Testing
bun run test: 11,143 pass, 197 fail in the initial unit/API/integration stage; 191 were chart tests requiring missing Helm, four packaging tests require missing 7-Zip, and two were the quoted-column regressions subsequently fixed and rerun green in the focused selection. The chained later stages therefore did not run through this command; components were run separately above. No full-suite or full-coverage pass claimed. Browser E2E and live PostgreSQL were not run locally; CI remains the merge gate.This uses the provider's existing dot-delimited table-label representation. It does not redesign schema metadata or add support for completing partially quoted input or quoting column suggestions.
AI-assisted implementation and validation.