Skip to content

fix: CockroachDB adapter phase 2 — fix SQL generation and remove soft-fail#1999

Merged
bpamiri merged 1 commit intodevelopfrom
peter/cockroachdb-adapter-phase2
Mar 27, 2026
Merged

fix: CockroachDB adapter phase 2 — fix SQL generation and remove soft-fail#1999
bpamiri merged 1 commit intodevelopfrom
peter/cockroachdb-adapter-phase2

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Mar 27, 2026

Summary

  • Fix SQL generation: Add CockroachDB to adapter name checks in update.cfc and sql.cfc that previously only listed PostgreSQL,H2,Oracle,SQLite — CockroachDB's UPDATE SET clauses were generating invalid SQL
  • Fix identity select on Adobe CF: Pass RETURNING clause query result as returningIdentity to $identitySelect, and add the parameter to all adapter signatures. Fixes generated key retrieval on Adobe CF + CockroachDB
  • Fix boolean type mapping: Change cf_sql_boolean to cf_sql_bit in CockroachDB adapter for Adobe CF compatibility
  • Add adapter-specific test suites: New CockroachDBCrudSpec, CockroachDBTransactionSpec, CockroachDBTypeSpec for CockroachDB-appropriate test coverage
  • Remove CockroachDB from SOFT_FAIL_DBS: CockroachDB is now a first-class CI target

Closes #1972, closes #1974

Test plan

  • Lucee 6 + CockroachDB: 2309 pass, 0 fail, 0 error
  • Adobe 2025 + CockroachDB: 2309 pass, 0 fail, 0 error
  • Lucee 6 + H2 (regression): 2278 pass, 0 fail, 0 error
  • CI passes with CockroachDB as blocking database across all engines

🤖 Generated with Claude Code

…-fail

CockroachDB was marked as soft-fail in CI because tests failed. Three root
causes fixed:

1. Missing CockroachDB in adapter name checks — update.cfc and sql.cfc had
   hardcoded adapter lists (PostgreSQL,H2,...) that excluded CockroachDB,
   causing UPDATE SET clauses to generate invalid SQL.

2. Identity select not passing RETURNING result — $executeQuery now passes
   the cfquery result as returningIdentity to $identitySelect, fixing
   generated key retrieval on Adobe CF.

3. Boolean type mapping — changed cf_sql_boolean to cf_sql_bit for Adobe CF
   compatibility (ACF doesn't support cf_sql_boolean in cfqueryparam).

Also adds CockroachDB-specific test specs (CRUD, transactions, types) and
guards core tests that assume sequential IDs or PostgreSQL transaction
semantics.

Closes #1972, closes #1974

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit dfdaf79 into develop Mar 27, 2026
1 of 7 checks passed
@bpamiri bpamiri deleted the peter/cockroachdb-adapter-phase2 branch March 27, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CockroachDB: expand $getType() coverage in model adapter CockroachDB: define adapter-specific sqlTypes in migrator

1 participant