Write SQL. Get type-safe code. In any language.#
-- @name ListActiveUsers
-- @returns :many
SELECT u.id, u.name, o.total
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE u.status = 'active';Scythe infers that o.total is nullable because it comes from the right side of a LEFT JOIN, and generates a matching optional field in every target language, from Rust's Option<Decimal> to Python's decimal.Decimal | None.
Install via cargo, npm, pip, Homebrew, or from source
Go from a SQL schema to generated code in six steps
Convert an existing sqlc project automatically
Every command, flag, and exit code
scythe.toml sections, backends, and row types
How nullability is derived from JOINs, CASE, and aggregates
59 built-in correctness and style rules
35 rules for dangerous SQL and privilege issues
Map extension and domain types with overrides
56 backends across 10 languages
Dataclass, pydantic, and msgspec row types
PostgreSQL, MySQL, SQLite, and 7 more engines
Why Scythe#
- 10 languages, 56 backends — Rust, Python, TypeScript, Go, Java, Kotlin, C#, Elixir, Ruby, and PHP
- 10 databases — PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, CockroachDB, Redshift, SQL Server, Oracle, and Snowflake
- 59 built-in rules combining SQL linting and security auditing
- Smart type inference across JOINs, CASE expressions, aggregates, and window functions
- No database required at generation time — scythe parses your schema statically;
scythe check --database-urlcan additionally verify against a live PostgreSQL database
Next Steps#
- Read the Quickstart to generate your first typed code from a real schema.
- See how Scythe compares to sqlc, SQLDelight, jOOQ, and ORMs.