Refactor keyword handling and update to official database sources - #6
Merged
Conversation
pseudomuto
commented
Oct 15, 2025
Owner
- Replace IsReservedKeyword driver method with Keywords() method
- Add shared IsReservedKeyword function in driver.go for consistency
- Update PostgreSQL keywords to official PostgreSQL 16 reserved words
- Update MySQL keywords to official MySQL 8.0 reserved words
- Optimize ClickHouse keywords based on non-reserved keyword philosophy
- Add comprehensive documentation with official sources and update dates
- Maintain test compatibility while improving keyword accuracy
- Replace IsReservedKeyword driver method with Keywords() method - Add shared IsReservedKeyword function in driver.go for consistency - Update PostgreSQL keywords to official PostgreSQL 16 reserved words - Update MySQL keywords to official MySQL 8.0 reserved words - Optimize ClickHouse keywords based on non-reserved keyword philosophy - Add comprehensive documentation with official sources and update dates - Maintain test compatibility while improving keyword accuracy
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors keyword handling across database drivers by replacing individual IsReservedKeyword methods with a standardized Keywords() method and centralizing keyword checking logic. It also updates all database-specific keyword lists to reflect official documentation for PostgreSQL 16, MySQL 8.0, and optimizes ClickHouse keywords based on their non-reserved philosophy.
- Replace driver-specific
IsReservedKeywordmethods with unifiedKeywords()methods - Add shared
IsReservedKeywordfunction in driver.go for consistent keyword checking - Update keyword lists to official sources with comprehensive documentation
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| drivers/postgres/postgres.go | Remove keywords field and IsReservedKeyword method, add Keywords() method |
| drivers/postgres/keywords.go | Convert map to slice with PostgreSQL 16 official keywords and documentation |
| drivers/mysql/mysql.go | Remove keywords field and IsReservedKeyword method, add Keywords() method |
| drivers/mysql/keywords.go | Convert map to slice with MySQL 8.0 official keywords and documentation |
| drivers/clickhouse/clickhouse.go | Remove keywords field and IsReservedKeyword method, add Keywords() method |
| drivers/clickhouse/keywords.go | Convert map to slice with optimized ClickHouse keywords and documentation |
| driver_test.go | Update MockDriver to use Keywords() method instead of IsReservedKeyword |
| driver.go | Add shared IsReservedKeyword function and update NeedsQuoting to use it |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.