Installation

Install SQLSpec with the extras that match your databases and tooling.

Install bundles

uv pip install sqlspec
# or
pip install sqlspec
uv pip install "sqlspec[asyncpg]"
uv pip install "sqlspec[psycopg]"
uv pip install "sqlspec[psqlpy]"
uv pip install "sqlspec[aiosqlite]"
uv pip install "sqlspec[asyncmy]"
uv pip install "sqlspec[mysql-connector]"
uv pip install "sqlspec[pymysql]"
uv pip install "sqlspec[oracledb]"
uv pip install "sqlspec[duckdb]"
uv pip install "sqlspec[bigquery]"
uv pip install "sqlspec[spanner]"
uv pip install "sqlspec[adbc]"
uv pip install "sqlspec[litestar]"
uv pip install "sqlspec[fastapi]"
uv pip install "sqlspec[flask]"
uv pip install "sqlspec[opentelemetry]"
uv pip install "sqlspec[prometheus]"
uv pip install "sqlspec[pandas]"
uv pip install "sqlspec[polars]"
uv pip install "sqlspec[fsspec]"
uv pip install "sqlspec[obstore]"
uv pip install "sqlspec[msgspec]"
uv pip install "sqlspec[pydantic]"
uv pip install "sqlspec[attrs]"
uv pip install "sqlspec[orjson]"
uv pip install "sqlspec[performance]"

Package groups

Extra

Includes

What it is for

adbc

adbc_driver_manager, pyarrow

Arrow Database Connectivity drivers.

adk

google-adk

Google ADK storage extension.

aioodbc

aioodbc

Async ODBC connections.

aiosqlite

aiosqlite

Async SQLite driver.

alloydb

google-cloud-alloydb-connector

AlloyDB connector.

asyncmy

asyncmy

Async MySQL driver.

asyncpg

asyncpg

Async PostgreSQL driver.

attrs

attrs, cattrs

Result mapping with attrs models.

bigquery

google-cloud-bigquery, google-cloud-storage

BigQuery adapter dependencies.

cli

rich-click, tomli (Py<3.11)

CLI enhancements.

cloud-sql

cloud-sql-python-connector

Google Cloud SQL connector.

cockroachdb

psycopg[binary,pool], asyncpg

CockroachDB drivers.

duckdb

duckdb

DuckDB adapter.

fastapi

fastapi

FastAPI integration helpers.

flask

flask

Flask integration helpers.

fsspec

fsspec

Storage helpers using fsspec.

litestar

litestar

Litestar integration helpers.

msgspec

msgspec

High-performance result mapping.

mysql-connector

mysql-connector-python

MySQL connector driver.

nanoid

fastnanoid

NanoID utilities.

obstore

obstore

Object storage helpers.

opentelemetry

opentelemetry-instrumentation

OpenTelemetry instrumentation.

oracledb

oracledb

Oracle Database adapter.

orjson

orjson

Fast JSON serialization.

pandas

pandas, pyarrow

Pandas data export.

performance

sqlglot[rs], msgspec

Rust-based SQL parsing + msgspec.

polars

polars, pyarrow

Polars data export.

prometheus

prometheus-client

Prometheus metrics.

psqlpy

psqlpy

Async PostgreSQL (Rust).

psycopg

psycopg[binary,pool]

Sync/async PostgreSQL driver.

pydantic

pydantic, pydantic-extra-types

Result mapping with Pydantic models.

pymssql

pymssql

MSSQL driver.

pymysql

pymysql

MySQL driver.

spanner

google-cloud-spanner

Cloud Spanner adapter.

uuid

uuid-utils

UUID helpers.

Multiple extras

uv pip install "sqlspec[asyncpg,msgspec,litestar]"
# or
pip install "sqlspec[asyncpg,msgspec,litestar]"

Next steps

Head to Quickstart to run your first query.