Skip to content

Fix SQL dump table identifier escaping#235

Open
swhan0329 wants to merge 1 commit into
outerbase:mainfrom
swhan0329:codex/quote-sql-dump-table-names
Open

Fix SQL dump table identifier escaping#235
swhan0329 wants to merge 1 commit into
outerbase:mainfrom
swhan0329:codex/quote-sql-dump-table-names

Conversation

@swhan0329
Copy link
Copy Markdown

/claim #59

Summary

  • quote sqlite_master name lookups so table names containing single quotes do not break schema discovery
  • quote table identifiers for dump SELECTs and generated INSERT statements when names contain spaces/quotes or common SQLite keywords
  • add regression coverage for a table name that needs both SQL string escaping and identifier quoting

This keeps the change scoped to SQL dump correctness and does not touch the broader streaming/R2 export paths.

Verification

  • pnpm exec vitest run src/export/dump.test.ts
  • pnpm exec prettier --check src/export/dump.ts src/export/dump.test.ts
  • git diff --check
  • pnpm run build

Demo

  • The new regression test exercises a table named kid's profiles and verifies the escaped schema lookup, quoted SELECT, and quoted INSERT dump output.

@swhan0329
Copy link
Copy Markdown
Author

Fresh local verification because this PR does not have GitHub checks attached:

  • pnpm exec vitest run src/export/dump.test.ts -> 1 file / 6 tests passed
  • pnpm exec prettier --check src/export/dump.ts src/export/dump.test.ts -> passed
  • pnpm run build -> passed
  • git diff --check -> passed

The change remains scoped to SQL dump correctness for table names that need SQLite string escaping and identifier quoting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant