Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not capitalize reserved words when used as column names #60

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

nielm
Copy link
Collaborator

@nielm nielm commented Jan 26, 2024

This preserves the case of reserved words used as column names (eg "key", "index", "table" etc) in most places they are used:

  • defining columns in tables
  • referencing columns in indexes
  • referencing columns in primary and foreign keys

It does not preserve the case of reserved words when used as column names in the SQL expressions used for check constraints and generated columns. This is because this tool does not have an SQL expression parser or validator and so it is impossible to distinguish between a reserved keyword in an SQL expression and a column name. The workaround here is to use backquotes to quote the column names: eg: ``key``

Fixes #35

(note does not work in CHECK constraint and generated column expressions)
@nielm nielm merged commit cfb28ce into cloudspannerecosystem:main Jan 26, 2024
3 checks passed
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.

Diff uppercases fields if they match a reserved word in CREATE INDEX statement
1 participant