Schema Input
DBSprout reads a database schema from a live connection, a schema file, or
Django models. Every source produces the same unified DatabaseSchema model
internally.
Live Database Introspection
Connect directly to a running database:
# PostgreSQL
dbsprout init --db postgresql://user:pass@host:5432/dbname
# MySQL
dbsprout init --db mysql+pymysql://user:pass@host:3306/dbname
# SQLite
dbsprout init --db sqlite:///path/to/database.db
# SQL Server (requires the [mssql] extra)
dbsprout init --db mssql+pyodbc://user:pass@host:1433/dbname
DBSprout uses SQLAlchemy’s Inspector to read tables, columns, primary keys,
foreign keys, indexes, and constraints. The connection URL can also be
supplied via the DBSPROUT_TARGET_DB environment variable.
SQL DDL Files
Parse CREATE TABLE statements from a .sql file:
dbsprout init --file schema.sql
Supports PostgreSQL, MySQL, and SQLite DDL dialects.
DBML
Parse DBML schema files:
dbsprout init --file schema.dbml
Prisma Schema
Parse Prisma schema files:
dbsprout init --file schema.prisma
Mermaid ER Diagrams
Parse Mermaid entity-relationship diagrams:
dbsprout init --file schema.mmd
PlantUML
Parse PlantUML entity diagrams:
dbsprout init --file schema.puml
Django Models
Introspect Django model definitions directly from your project:
# All apps
dbsprout init --django
# Limit to specific app labels
dbsprout init --django --django-apps myapp,billing
Preview Without Writing
Add --dry-run to any init invocation to inspect the parsed schema without
writing dbsprout.toml or a snapshot:
dbsprout init --file schema.sql --dry-run