Skip to content

fix(rds): split schema-qualified identifiers in query builders#249

Merged
bentsku merged 2 commits into
mainfrom
fix-rds-split-id
Jun 24, 2026
Merged

fix(rds): split schema-qualified identifiers in query builders#249
bentsku merged 2 commits into
mainfrom
fix-rds-split-id

Conversation

@bentsku

@bentsku bentsku commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

select() and the other @aws-appsync/utils/rds query builders quoted the entire raw identifier as a single unit, so select({table: "domain.item"}) emitted SELECT * FROM "domain.item"; one literal relation Postgres looks up verbatim, which doesn't exist. The same defect hit column-qualified names (columns: ['persons.name'] -> "persons.name").

Add a quoteIdentifier() helper that splits qualified identifiers on . and quotes each segment, matching AWS AppSync (ù"domain"."item", "persons"."name"`), and route every identifier-quoting site (table/column names across select/insert/update/remove/where/orderBy/returning) through it.

Tests assert parity against snapshots captured from real AWS via test:aws; unqualified names remain quoted as a single segment.

I manually tested the fix with a reproduction sample and can attest that this fixed it in LocalStack as well.

Done with Claude Code and a bit of manual steering

towards AWS-1011

select() and the other @aws-appsync/utils/rds query builders quoted the
entire raw identifier as a single unit, so select({table: "domain.item"})
emitted SELECT * FROM "domain.item" -- one literal relation Postgres looks
up verbatim, which doesn't exist. The same defect hit column-qualified
names (columns: ['persons.name'] -> "persons.name").

Add a quoteIdentifier() helper that splits qualified identifiers on `.`
and quotes each segment, matching AWS AppSync ("domain"."item",
"persons"."name"), and route every identifier-quoting site (table/column
names across select/insert/update/remove/where/orderBy/returning) through
it.

Tests assert parity against snapshots captured from real AWS via
test:aws; unqualified names remain quoted as a single segment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bentsku bentsku marked this pull request as ready for review June 24, 2026 16:40

@pinzon pinzon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@bentsku bentsku merged commit 4677212 into main Jun 24, 2026
4 checks passed
@bentsku bentsku deleted the fix-rds-split-id branch June 24, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants