Skip to content

Databases

The Bridge can broker access to seven database systems: MySQL, PostgreSQL, CockroachDB, SQL Server (MSSQL), Redis, MongoDB, and Cassandra. In every case the user reaches the database through a brokered, recorded session and never holds the real database credentials.

Each database can be offered two ways, and you can use either or both:

  • Native mode - users point their normal database tool at a port on the Bridge. That can be a command-line client (mysql, psql, redis-cli, mongosh, and so on) or a graphical tool (DBeaver, TablePlus, MySQL Workbench, etc.). To the tool it looks like an ordinary database connection; the Bridge stands in the middle.
  • Browser mode - users run queries in a built-in query window inside the Bridge web interface, with nothing to install.

Jump to an engine: MySQL · PostgreSQL · CockroachDB · SQL Server · Redis · MongoDB · Cassandra

Granting access. Settings here enable database protocols for the deployment. To grant a person access to a database, create a checkout - see the database checkout options and a worked example.

The in-browser SQL client (auto-enabled)

There is no separate switch for the in-browser query window. It turns on automatically as soon as any database protocol has browser mode enabled. For example, enabling browser mode for PostgreSQL alone makes the in-browser SQL client available for it; adding MySQL browser mode extends the same client to MySQL too.

bridge.yaml
postgres:
  browser:
    enabled: true   # this alone activates the in-browser SQL client

How native mode works

Pick a port for the Bridge to listen on, then have users point their client at the Bridge instead of the real database. The default ports below match each database’s conventional port, so existing tools usually need only the address changed.

# MySQL example - connect the normal client to the Bridge
mysql -h bridge.example.com -P 3306 -u 'alice%mysql-primary.internal' -p

For native database clients, Bridge routes the session from the database username. Use <bridge-user>%<target-host> as the username so Bridge can match the checkout and connect to the approved target.

Each database

MySQL

bridge.yaml
mysql:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "3306"
  browser:
    enabled: true

PostgreSQL

bridge.yaml
postgres:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "5432"
  browser:
    enabled: true

CockroachDB

CockroachDB speaks the PostgreSQL wire protocol but has its own conventional port.

bridge.yaml
cockroachdb:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "26257"
  browser:
    enabled: true

SQL Server (MSSQL)

bridge.yaml
mssql:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "1433"
  browser:
    enabled: true

Redis

bridge.yaml
redis:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "6379"
  browser:
    enabled: true

MongoDB

bridge.yaml
mongodb:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "27017"
  browser:
    enabled: true

Cassandra

bridge.yaml
cassandra:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "9042"
  browser:
    enabled: true

Mixing modes

You can enable native for some databases and browser for others, or both for the same database. This example offers PostgreSQL through users’ own tools, MySQL through the browser, and Redis through both.

bridge.yaml
postgres:
  native:
    enabled: true
    listen: "5432"

mysql:
  browser:
    enabled: true

redis:
  native:
    enabled: true
    listen: "6379"
  browser:
    enabled: true

Option reference

Each database protocol exposes the same three-part structure. The default native port differs per database.

OptionTypeDefaultDescription
mysql.idle_timeoutduration30mClose a session after this much inactivity.
mysql.native.enabledboolfalseTurn on native MySQL (a listening port).
mysql.native.listenstring (port)3306Port the Bridge listens on. Required when native is enabled.
mysql.browser.enabledboolfalseTurn on the in-browser SQL client for MySQL.
postgres.idle_timeoutduration30mClose a session after this much inactivity.
postgres.native.enabledboolfalseTurn on native PostgreSQL.
postgres.native.listenstring (port)5432Port the Bridge listens on. Required when native is enabled.
postgres.browser.enabledboolfalseTurn on the in-browser SQL client for PostgreSQL.
cockroachdb.idle_timeoutduration30mClose a session after this much inactivity.
cockroachdb.native.enabledboolfalseTurn on native CockroachDB.
cockroachdb.native.listenstring (port)26257Port the Bridge listens on. Required when native is enabled.
cockroachdb.browser.enabledboolfalseTurn on the in-browser SQL client for CockroachDB.
mssql.idle_timeoutduration30mClose a session after this much inactivity.
mssql.native.enabledboolfalseTurn on native SQL Server.
mssql.native.listenstring (port)1433Port the Bridge listens on. Required when native is enabled.
mssql.browser.enabledboolfalseTurn on the in-browser SQL client for SQL Server.
redis.idle_timeoutduration30mClose a session after this much inactivity.
redis.native.enabledboolfalseTurn on native Redis.
redis.native.listenstring (port)6379Port the Bridge listens on. Required when native is enabled.
redis.browser.enabledboolfalseTurn on the in-browser client for Redis.
mongodb.idle_timeoutduration30mClose a session after this much inactivity.
mongodb.native.enabledboolfalseTurn on native MongoDB.
mongodb.native.listenstring (port)27017Port the Bridge listens on. Required when native is enabled.
mongodb.browser.enabledboolfalseTurn on the in-browser client for MongoDB.
cassandra.idle_timeoutduration30mClose a session after this much inactivity.
cassandra.native.enabledboolfalseTurn on native Cassandra.
cassandra.native.listenstring (port)9042Port the Bridge listens on. Required when native is enabled.
cassandra.browser.enabledboolfalseTurn on the in-browser client for Cassandra.
Last updated on