feat: add CockroachDB database adapter#1876
Merged
Conversation
CockroachDB uses the PostgreSQL wire protocol but enforces strict type checking that rejects boolean-to-bit/integer comparisons. The PostgreSQL adapter maps boolean columns to cf_sql_bit, which causes "unsupported comparison operator: <boolean> = <integer>" errors on CockroachDB. - Add CockroachDB adapter extending PostgreSQL adapter, mapping bool/boolean types to cf_sql_boolean instead of cf_sql_bit - Add CockroachDB migrator extending PostgreSQL migrator - Detect CockroachDB via database_productname before the PostgreSQL driver_name check (since CockroachDB uses the PostgreSQL JDBC driver) - Update supported database list in error messages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
booleancolumns tocf_sql_bit, which causesunsupported comparison operator: <boolean> = <integer>errors on CockroachDB$getType()to mapbool/booleantocf_sql_boolean, which the JDBC driver correctly sends as a native boolean parameterdatabase_productname(which CockroachDB reports as "CockroachDB") before the PostgreSQLdriver_namecheck, since CockroachDB uses the standard PostgreSQL JDBC driverChanges
databaseAdapters/CockroachDB/CockroachDBModel.cfc— extends PostgreSQLModel, overrides boolean type mappingdatabaseAdapters/CockroachDB/CockroachDBMigrator.cfc— extends PostgreSQLMigratorModel.cfc— adds CockroachDB detection before PostgreSQL checkmigrator/Base.cfc— adds CockroachDB detection for migrationsmigrator/Migration.cfc— updates supported database list in error messageTest plan
database_productname= "CockroachDB")cf_sql_booleanparameter type, resolving strict type comparison errors🤖 Generated with Claude Code