Switchboard Docs
Data engineering

Connect a database

Copy database tables into source resources.

A database source copies tables into Switchboard. This guide uses MySQL (direct) as a worked example. Other database connectors have different connection forms. Check the connector list for the available choices.

Before you start

You need Builder, Admin, or a custom role with source editing access. Contact our support team to arrange database network access and permissions before connecting. For MySQL (direct), obtain these details from your database administrator:

  • A database host, port, and database name.
  • A read-only database user and password.
  • The tables, primary keys, and update timestamps to copy.

An SSH bastion is a server that forwards the connection into a private network. A primary key identifies one row. An update timestamp records when that row changed.

Connect MySQL

Continue once network access and permissions are configured.

  1. In Sources, select Add Data Source, then MySQL (direct).
  2. Enter a Source name and select Continue.
  3. Fill in Host, Port, Database, User, and Password.
  4. For a private network, also fill in SSH host, SSH port, SSH user, and SSH private key.
  5. Select Connect. Use Test Connection to check the result when available.

The default database port is 3306. The default SSH port is 22. Without a bastion, this connector connects directly over TLS.

Add a table

  1. Under Resources, select Add resource.
  2. Enter the resource details. Set Table to a table name, such as orders or sales.orders.
  3. Set the primary keys to the columns that identify a row. The initial key is id; verify it.
  4. Set Incremental field to the table's update timestamp. It must be a DATETIME or TIMESTAMP column.
  5. Set Lookback hours to cover the period you want each run to reread.
  6. Review the resource schedule and select Add resource.
  7. Select Synchronize now and check the resource's status.

The defaults run every 30 minutes and reread 2.5 hours of changes. The lookback determines how much recent data each run rereads. Increase it when you choose a slower schedule. For older records, use a backfill.

Without an Incremental field, each run reloads the whole table.

Resolve connection and table errors

A connection error can indicate a wrong credential, blocked network route, or SSH key problem. A resource error can indicate a missing table, invalid column, or insufficient database access. Contact our support team for network, credential, or permission errors. Check the resource's table and column names before retrying.

After the sync succeeds, create a model from the resource.

On this page