Browse documentation

Engines

CockroachDB

Bobby Tables connects to CockroachDB through its PostgreSQL wire protocol and opens each connection in a SQL workspace that keeps CockroachDB catalog queries and limits.

Where to find it

ActionHow
Choose CockroachDBNew connection, ⌘N (Ctrl+N), then CockroachDB under Choose a provider
Fill the form from a URLUse connection URL with a cockroachdb:// or cockroach:// URL, then Fill fields
Default port and database26257 and defaultdb

A postgresql:// URL also fills the form as CockroachDB when it uses port 26257 or a cockroachlabs.cloud host. URLs the app copies use cockroachdb://, so change the scheme to postgresql:// for tools that only know PostgreSQL.

Connecting

The form asks for Host, Port, User, Database and Password. CockroachDB Cloud connections normally use Verify Full in the TLS section, a local insecure cluster uses Disable, and SSH and TLS covers certificates and tunnels. Test connection reads the server version and refuses a PostgreSQL server selected as CockroachDB. Open in read-only mode sets default_transaction_read_only on the session and disables editing.

What works

  • Browse databases, schemas, tables, views, sequences and enum types in the table grid.
  • Stage inserts, updates and deletes, then commit them in one transaction, as described in Editing.
  • Change structure in the Structure tab, with the DDL run inside a transaction.
  • Snapshots are not available, so Create snapshot... does not appear.
  • Draw a schema diagram from declared foreign keys.
  • Format result columns with result directives.
  • Stop a running statement with Cancel, ⌘. (Ctrl+.).
  • Run Explain, ⌘⇧E (Ctrl+Shift+E), in the SQL editor.

Engine notes

CockroachDB can abort a transaction under contention, and Bobby Tables reports the error without replaying the write. After a 40001 failure, the commit dialog says another transaction changed the same data, keeps the pending changes and asks you to retry the complete transaction. After 40003 the commit may have succeeded, so verify the rows before retrying. 25P02 means the transaction failed and must be rolled back before anything else runs.

Good to know

  • CockroachDB does not use native COPY, estimated row counts or the process list. CSV import takes the generic path.
  • Functions and triggers are not listed in the catalog.
  • The PostgreSQL page has a short video of opening a connection from Home.