Overview

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.

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-url can additionally verify against a live PostgreSQL database

Next Steps#

Updated

Was this page helpful?