Skip to content
Documentation

Documentation

sqlc-gen-better-python is a sqlc plugin that turns your SQL schema and queries into modern, fully typed Python database code: models, typed query functions, and enums. You keep writing SQL; the Python stays in sync with it.

Explore by feature

At a glance

Python3.12 or newer
EnginesPostgreSQL, SQLite
Driversasyncpg, psycopg_async, psycopg_sync, aiosqlite, sqlite3, and experimental turso_async/turso_sync
Model typesdataclass, attrs, msgspec, pydantic
Docstringsgoogle, numpy, pep257, or none
Checked withpyright (strict) and ruff

Full details in the feature support reference.

Getting help