Skip to content

Conversation

@hongkongkiwi
Copy link

Summary

This PR adds CockroachDB support to SeaORM. CockroachDB is wire-compatible with PostgreSQL, so most functionality works with the existing sqlx-postgres driver.

Changes

  • Added cockroachdb feature flag
  • Added DatabaseBackend::Cockroach variant
  • Added URL scheme handling (cockroachdb://, postgres://, postgresql://)
  • Added schema generation for IDENTITY columns (not SERIAL)
  • Added documentation
  • Added tests

Feature Flags

Feature Description
cockroachdb Enable CockroachDB support
cockroachdb-use-identity-pk Use IDENTITY columns for primary keys

Testing

Added tests/cockroachdb_tests.rs with tests for:

  • Backend detection with various URL schemes
  • Schema generation using IDENTITY columns
  • Boolean value conversion

Breaking Changes

None - all changes are gated behind the new cockroachdb feature flag.


Related: #2929

- Added DatabaseBackend::Cockroach variant
- Added cockroachdb feature flag
- Added schema generation for IDENTITY columns
- Added documentation and tests

Related: SeaQL/sea-query#329
@hongkongkiwi hongkongkiwi changed the title Add CockroachDB support feat: Add CockroachDB support Jan 26, 2026
@hongkongkiwi hongkongkiwi mentioned this pull request Jan 26, 2026
10 tasks
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.

1 participant