Skip to content

Make Drivers Simpler - #5

Merged
pseudomuto merged 1 commit into
mainfrom
driver_needs_quoting_dryness
Oct 15, 2025
Merged

Make Drivers Simpler#5
pseudomuto merged 1 commit into
mainfrom
driver_needs_quoting_dryness

Conversation

@pseudomuto

Copy link
Copy Markdown
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
@pseudomuto
pseudomuto requested a review from Copilot October 15, 2025 01:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@pseudomuto
pseudomuto merged commit 5b1122e into main Oct 15, 2025
3 checks passed
@pseudomuto
pseudomuto deleted the driver_needs_quoting_dryness branch October 15, 2025 01:56
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