Skip to content

Database Support

ContextKit connects to your database to introspect schemas, validate metadata against live data, and verify golden queries. It supports a wide range of databases through optional peer dependencies — install only the driver you need.

PostgreSQL

Also works with Neon, Supabase, Redshift, CockroachDB, AlloyDB, and any Postgres wire-compatible database.

DuckDB

Local .duckdb files, in-memory databases, Parquet/CSV/JSON via DuckDB views. Also works with MotherDuck.

MySQL / MariaDB

MySQL 5.7+, 8.x, MariaDB 10.x+. Works with PlanetScale, TiDB, and other MySQL-compatible services.

SQL Server

Microsoft SQL Server 2016+. Also works with Azure SQL Database.

Snowflake

Full support for Snowflake accounts with warehouse/database/schema selection.

BigQuery

Google BigQuery with service account authentication and dataset selection.

ClickHouse

ClickHouse HTTP interface. Works with ClickHouse Cloud.

Databricks

Databricks SQL warehouses via server hostname and HTTP path.

SQLite

Local .sqlite / .db files for lightweight or embedded databases.

The fastest way to connect is the interactive wizard:

Terminal window
context setup

It will auto-detect databases from your environment, MCP configs (Claude Code, Cursor, VS Code, Windsurf), and contextkit.config.yaml.

PostgreSQL, MySQL, and SQL Server use standard connection strings:

contextkit.config.yaml
data_sources:
warehouse:
adapter: postgres
connection: postgresql://user:pass@host:5432/dbname

Also works for Neon, Supabase, Redshift, CockroachDB — they all speak the PostgreSQL wire protocol.

contextkit.config.yaml
data_sources:
analytics:
adapter: duckdb
path: ./data/warehouse.duckdb

DuckDB is included by default — no extra install needed.

contextkit.config.yaml
data_sources:
snowflake:
adapter: snowflake
account: xy12345.us-east-1
username: analyst
password: ${SNOWFLAKE_PASSWORD}
warehouse: COMPUTE_WH
database: ANALYTICS
schema: PUBLIC

Install the driver: npm install snowflake-sdk

ContextKit uses optional peer dependencies — install only the driver for your database:

DatabaseDriver PackageInstall Command
DuckDBduckdbIncluded by default
PostgreSQLpgnpm install pg
MySQL / MariaDBmysql2npm install mysql2
SQL Servermssqlnpm install mssql
Snowflakesnowflake-sdknpm install snowflake-sdk
BigQuery@google-cloud/bigquerynpm install @google-cloud/bigquery
ClickHouse@clickhouse/clientnpm install @clickhouse/client
Databricks@databricks/sqlnpm install @databricks/sql
SQLitebetter-sqlite3npm install better-sqlite3

If a driver is missing, ContextKit will tell you exactly which package to install.

When you run context setup, ContextKit scans your IDE MCP configs to find databases you’ve already connected:

IDEConfig Location
Claude Code~/.claude.json, <project>/.mcp.json
Cursor~/.cursor/mcp.json, <project>/.cursor/mcp.json
VS Code / Copilot<project>/.vscode/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json

If a database MCP server is found, context setup offers it as the first option — no connection string needed.

For non-interactive use, pass a connection string directly:

Terminal window
# PostgreSQL (also Neon, Supabase, Redshift)
context introspect --db postgres://user:pass@host:5432/db
# DuckDB
context introspect --db ./warehouse.duckdb
# MySQL
context introspect --db mysql://user:pass@host:3306/db
# SQL Server
context introspect --db mssql://user:pass@host:1433/db
# Snowflake (via config)
context introspect --source snowflake
# BigQuery (via config)
context introspect --source bigquery

Cloud warehouses (Snowflake, BigQuery, ClickHouse, Databricks) require multiple credentials and should be configured in contextkit.config.yaml rather than passed as a single URL.

Configure multiple databases if your models span different systems:

contextkit.config.yaml
data_sources:
events:
adapter: clickhouse
host: click.example.com
database: events
users:
adapter: postgres
connection: ${USERS_DB_URL}
analytics:
adapter: duckdb
path: ./data/analytics.duckdb

Each model’s source field determines which data source is used for validation and introspection.