Make Drivers Simpler - #5
Merged
Merged
Conversation
pseudomuto
commented
Oct 15, 2025
Owner
- Extract shared NeedsQuoting function to driver.go
- Standardize SupportsFeature implementation using supportedFeatures slices across all drivers
- Reorganize file structure to follow consistent patterns (grouped type declarations)
- Maintain identical functionality while improving maintainability
- Extract shared NeedsQuoting function to driver.go to eliminate 72 lines of duplicate code - Standardize SupportsFeature implementation using supportedFeatures slices across all drivers - Reorganize file structure to follow consistent patterns (grouped type declarations) - Maintain identical functionality while improving maintainability
There was a problem hiding this comment.
Pull Request Overview
Simplify and standardize driver implementations by centralizing common identifier quoting logic and unifying feature support checks across drivers.
- Extract common NeedsQuoting logic into a shared function in driver.go
- Replace switch-based SupportsFeature implementations with standardized supportedFeatures slices and slices.Contains checks
- Minor structural cleanup using grouped type declarations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| drivers/postgres/postgres.go | Switch to where.NeedsQuoting and introduce supportedFeatures with slices.Contains for SupportsFeature |
| drivers/mysql/mysql.go | Switch to where.NeedsQuoting and introduce supportedFeatures with slices.Contains for SupportsFeature |
| drivers/clickhouse/clickhouse.go | Switch to where.NeedsQuoting and introduce a features slice; unify SupportsFeature via slices.Contains |
| driver.go | Add grouped type declaration and introduce shared NeedsQuoting function used by all drivers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.