Skip to content

Strip quotes out from column and table names#94

Merged
not-night-but merged 5 commits into
mainfrom
fix/ident-quoting-columns-tables
May 21, 2026
Merged

Strip quotes out from column and table names#94
not-night-but merged 5 commits into
mainfrom
fix/ident-quoting-columns-tables

Conversation

@not-night-but
Copy link
Copy Markdown
Contributor

Strip out the identifier quoting from identifier tokens for tables and columns. Also unescape anything that was escaped within that token (so "a""b" will be returned as a"b)

Copy link
Copy Markdown
Contributor

@rathboma rathboma left a comment

Choose a reason for hiding this comment

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

I think there's a test case that will break it, but otherwise looks good. Going to approve, but please validate the test

Comment thread src/utils.ts

const inner = value.slice(1, -1);

if (dialect === 'bigquery' && start === '`') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can the dialect -> quote character mapping code be centralized somehow, it seems a bit scattered

Comment thread src/utils.ts Outdated
Comment thread src/utils.ts
if (dialect === 'mssql') {
return ['"', '['];
} else {
return ['"', '`'];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure backticks are supported by everything? Are " characters supported by everything?

Comment thread test/identifier/columns.spec.ts
@not-night-but not-night-but merged commit 338686f into main May 21, 2026
9 checks passed
@not-night-but not-night-but deleted the fix/ident-quoting-columns-tables branch May 21, 2026 23:52
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