Conversation
Add WithSQLTablePlaceholder for verbatim INSERT targets when the table name is unresolved; golden tests sketch PG column quoting with raw placeholders. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for SQL table placeholders in SQLInsertWriter via the new WithSQLTablePlaceholder option, allowing verbatim INSERT INTO target tokens when the real table name is unknown at export time. It also includes corresponding unit tests and error handling for empty placeholders. A review comment suggests updating the TableName() method to return the configured placeholder when set, ensuring consistency with its documented contract.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| sqlDialect databasepb.DatabaseDialect | ||
| batchSize int | ||
| batchPending int | ||
| tablePlaceholder string |
There was a problem hiding this comment.
When tablePlaceholder is configured, the actual table name used in the generated INSERT statements will be the placeholder, not table. However, TableName() currently still returns w.table (which may be empty). To ensure consistency with its documented contract ('TableName returns the qualified table name used in INSERT statements'), TableName() should be updated to return w.tablePlaceholder if it is set.
Summary
Draft scaffold for #146 — not merge-ready.
WithSQLTablePlaceholder(token)onSQLInsertWriter.NewSQLInsertWriter(out, "")when a placeholder is configured.ErrEmptyTablePlaceholderrejects empty placeholder tokens at construction.Passing scaffold tests
TABLE_NAMEplaceholder with GoogleSQL column quoting/* unresolved table */placeholder with PostgreSQL"id"column quotingSkipped golden sketches
Dependency on #147
#147 proposes rejecting
NewSQLInsertWriter(out, "")at construction when no placeholder is set. This scaffold intentionally allows emptytableonly whenWithSQLTablePlaceholderis present — the two issues must land together with clear error semantics:table="", no placeholderErrEmptyTableNameat construction (#147)table="", with placeholdertable="users", with placeholderOpen design questions
text/templatesupport vs single fixed token?SQLInsertWriteror on INSERT fragment helpers (writer: INSERT fragment helpers for custom batching layers #79)?Test plan
make checkpassesCloses #146 when complete — this PR is design review only.
Made with Cursor