Repository navigation
fix: quote identifiers in object preview queries - #39
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge. SummaryThe PR fixes object preview queries by quoting schema and object names separately.
No actionable issues were found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix: quote identifiers in object preview..." · Reviewed by Greptile |
sphr2k
force-pushed
the
fix/quote-object-select-identifiers
branch
from
October 28, 2026 09:55
bf67552 to
8ae2902
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the PostgreSQL identifier-quoting changes.
No open issues 🎉
What changed in this PR
Fixes object-browser preview queries for PostgreSQL identifiers containing mixed case, reserved words, spaces, punctuation, or embedded double quotes.
Changes:
- Adds a shared
generateObjectSelecthelper that quotes schema and object names separately and escapes embedded quotes. - Uses the helper for object previews and table/view “New Query” actions, preserving the 100-row limit.
- Adds five parameterized regression cases covering identifier quoting.
| File | Description |
|---|---|
tests/sql-generate.test.ts |
Adds five identifier-quoting regression cases. |
src/lib/sql/generate.ts |
Introduces the shared preview-query helper. |
src/components/sql-editor/SQLEditorLayout.tsx |
Uses quoted identifiers in object-browser previews. |
src/components/sql-editor/schema/ViewSchemaContent.tsx |
Uses the helper for view “New Query” actions. |
src/components/sql-editor/schema/TableSchemaContent.tsx |
Uses the helper for table “New Query” actions. |
Review effort: Balanced
tianzhou
approved these changes
Oct 28, 2026
tianzhou
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for the contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
generateObjectSelecthelper that quotes schema and object names separately and escapes embedded double quotes.Notes
The preview limit remains 100. For example, the object browser now generates
SELECT * FROM "ExampleSchema"."ExampleTable_V01" LIMIT 100;instead of folding the mixed-case identifiers to lowercase.Local validation used pnpm 10, which supports the repository's existing
pnpm.overridesconfiguration. No dependency or lockfile changes were needed.Validation
git diff upstream/main...HEAD --checknpm exec --yes --package=pnpm@10 -- pnpm install --frozen-lockfile(passes)npm exec --yes --package=pnpm@10 -- pnpm exec vitest run tests/sql-generate.test.ts(1 file, 15 tests passed)