Docs/Engines/CockroachDB

CockroachDB

CockroachDB speaks the PostgreSQL wire protocol but versions its own engine. DBLift registers a dedicated dialect for it, drops PostgreSQL’s version gates, and never suggests a concurrent index build.

type
cockroachdb
Driver
psycopg
DDL
Transactional
Config class
PostgreSQL

Install

pip install "dblift[cockroachdb]"

Connection URL

cockroachdb+psycopg://user:password@cluster.internal:26257/app

postgresql+psycopg:// and cockroachdb+psycopg:// URLs are both mapped to cockroachdb+psycopg. Only the psycopg driver is registered — any other DBAPI is rejected with an explanation.

dblift.yaml

database:
  type: cockroachdb
  url: "cockroachdb+psycopg://cluster.internal:26257/app"
  schema: "public"
  ssl_mode: "verify-full"

Engine settings

KeyDefaultEffect
schemapublicSets the connection's search_path, so unqualified objects land here.
ssl_mode—Passed through as PostgreSQL's sslmode: require, verify-ca, verify-full.
connection_timeout30Seconds to wait for a connection, sent as connect_timeout.
extra_params{}Any other libpq parameter, appended to the connection URL.

Behaviour notes

Indexes are always built online.

CONCURRENTLY is accepted as no-op syntax for PostgreSQL compatibility, so DBLift does not recommend adding a keyword that changes nothing.

PostgreSQL version gates do not apply.

CockroachDB versions its own engine, so version-gated PostgreSQL semantics are switched off.

The version banner is understood.

A dedicated dialect accepts CockroachDB’s banner instead of failing on it as the stock PostgreSQL dialect would.

Everything else follows PostgreSQL.

Same config keys, same transactional DDL, same cascading drops.