Design and Manage CockroachDB Databases Visually with DbSchema

DbSchema lets you design, manage, and document CockroachDB databases. Create ER diagrams, define tables and columns, and generate SQL scripts - with or without a live database connection.

Use Git to share the design, compare it with the CockroachDB database, and deploy changes. DbSchema also includes a data editor, query builder, and HTML5 documentation - everything you need in one tool.

DbSchema Database Designer

Download DbSchema Download CockroachDB JDBC Driver

CockroachDB is a distributed SQL database that speaks the PostgreSQL wire protocol and replicates data across nodes using the Raft consensus algorithm. Its schema model includes column families — groupings of columns stored together for access locality — and zone configurations that control data placement across regions. DbSchema connects via the PostgreSQL JDBC driver and exposes the full CockroachDB schema for visual design, documentation, and synchronization.

ER Diagram Design for CockroachDB Schemas

DbSchema reads tables, foreign keys, indexes, and column family definitions from CockroachDB's information schema and renders them as interactive ER diagrams. You can design multi-region schema layouts, annotate tables with notes, and export diagrams as HTML documentation for your distributed systems team.

Designing a CockroachDB schema with ER diagrams in DbSchema

SQL Editor with CockroachDB Distributed SQL Support

The DbSchema SQL editor connects directly to a CockroachDB cluster and supports the full PostgreSQL- compatible SQL dialect that CockroachDB implements, including SHOW RANGES, SHOW ZONE CONFIGURATIONS, and other cluster-management statements. Multiple editor tabs let you run queries against different databases within the same cluster simultaneously.

Running distributed SQL queries in CockroachDB using DbSchema's SQL editor

Schema Synchronization Across CockroachDB Environments

CockroachDB's online schema change mechanism applies DDL changes without locking tables, but keeping development and production schemas aligned still requires tooling. DbSchema compares two CockroachDB connections — or a saved schema file against a live cluster — and generates the PostgreSQL-compatible DDL needed to resolve differences.

Synchronizing CockroachDB schema changes between environments in DbSchema

Connecting DbSchema to CockroachDB

CockroachDB listens on port 26257 by default and accepts connections from any PostgreSQL JDBC driver, which DbSchema downloads automatically. The JDBC URL format is jdbc:postgresql://host:26257/dbname?sslmode=require. CockroachDB Serverless clusters require the full connection string from the CockroachDB Cloud console, which includes the cluster SNI header (options=--cluster=cluster-name) embedded in the URL. For CockroachDB Dedicated, download the cluster's CA certificate and reference it with the sslrootcert parameter.

Why Teams Use DbSchema with CockroachDB

  • Column family visibility — see how columns are grouped into storage families within each table in the ER diagram.
  • Multi-region layout — document zone configurations and regional table placements visually.
  • Schema diff and sync — compare dev and production CockroachDB clusters and generate targeted migration DDL.
  • Offline modeling — design schema changes locally without touching the cluster, then apply them using online schema changes.
  • Git-based history — store the DbSchema project file in Git to track every schema change as a versioned commit.