# TablePlus

[TablePlus](https://tableplus.com) supports native database connections on macOS, Windows and Linux. Use its DuckDB connection to read your destination, or connect to a supported warehouse. TablePlus has no JDBC driver interface or [Trino](../../querying/trino.md) connection.

| You have | Use |
|---|---|
| No warehouse yet | A [DuckDB connection](#duckdb-connection) with bootstrap commands |
| BigQuery | A BigQuery connection, with the tables from [BigQuery](../../querying/bigquery.md) |
| ClickHouse | A ClickHouse connection, with the tables from [ClickHouse](../../querying/clickhouse.md) |
| Records loaded into PostgreSQL or MySQL | A PostgreSQL or MySQL connection, with the tables from [PostgreSQL](../../querying/postgres.md) or [MySQL](../../querying/mysql.md) |

## DuckDB connection

TablePlus bundles its own DuckDB build, which reads your bucket or Iceberg table in place.

1. Click **Create a new connection** (or **Connection > New…**), choose **DuckDB**, and select a database file. Use a new, empty file such as `s2b.duckdb`.
2. In **Bootstrap commands**, paste the statements for your destination from [DuckDB](../../querying/duckdb.md#connect). TablePlus runs them right after it connects. For an Amazon S3 destination:

   ```sql
   INSTALL httpfs; LOAD httpfs;
   CREATE SECRET IF NOT EXISTS s2b_bucket (
     TYPE s3, KEY_ID '<access_key_id>', SECRET '<secret_access_key>', REGION '<region>');

   CREATE OR REPLACE VIEW records AS
   SELECT * FROM read_json(
     's3://<bucket>/<prefix>/s2b/stream=*/date=*/hour=*/*.ndjson.gz',
     format = 'newline_delimited',
     hive_partitioning = true,
     columns = {v: 'INTEGER', delivery_batch_id: 'VARCHAR', batch_id: 'VARCHAR',
                received_at: 'TIMESTAMPTZ', signal: 'VARCHAR',
                resource: 'JSON', scope: 'JSON', data: 'JSON'});
   ```

   Use a storage key that can only read the bucket.
3. Click **Test**, then **Connect**, and run the [example queries](../../querying/duckdb.md#example-queries) against `records`.

Run `SELECT version();` first. TablePlus updates its DuckDB build with app releases, and it can be older than the DuckDB you use elsewhere. Reading DuckLake catalogs that Send2Bucket writes needs DuckDB 2.0 or later; on an older build, read the DuckLake data through PostgreSQL or another client instead. A database file written by a newer DuckDB may not open in an older one, so let TablePlus create its own file.

## Warehouse connections

| Engine | TablePlus connection | Fields | Tables from |
|---|---|---|---|
| BigQuery | BigQuery | Project ID, dataset, and a service account JSON key file or application default credentials (gcloud) | [BigQuery](../../querying/bigquery.md) |
| ClickHouse | ClickHouse | Host, port, user, password and database | [ClickHouse](../../querying/clickhouse.md) |
| PostgreSQL | PostgreSQL | Host, port, user, password, database, and SSL mode | [PostgreSQL](../../querying/postgres.md) |
| MySQL or MariaDB | MySQL or MariaDB | Host, port, user, password and database | [MySQL](../../querying/mysql.md) |

TablePlus also connects to [Snowflake](../../querying/snowflake.md), by password, key pair, browser SSO or OAuth; use it once your records are in a Snowflake table. Use a read-only database user or role for each connection.

## Notes

- On macOS, TablePlus keeps connection passwords in the Keychain. Bootstrap commands are saved with the connection in plain text, so the storage key in them should be read-only.
- **Safe mode** makes TablePlus warn or ask for your password before it sends queries. Turn it on for connections to shared warehouses.
- A view over bucket objects reads the bucket on every query. Filter on `date` to read fewer objects.
