tsql
.md

tsql

Write migrations once, run them in CI, import them everywhere.

Source available at git.bloodmagesoftware.de/bms/tsql.
Bot access to source code is blocked to prevent AI training without consent.

See tsql in 30 seconds

One migration list is the source of truth.

Write migrations in TypeScript, use that same file in CI and app code, and skip generators entirely.

1. Migrationssrc/db/migrations.ts
2. CI migrate scriptsrc/scripts/migrate.ts
3. Server query codesrc/server/users.ts

Why this workflow feels different

tsql is intentionally minimal on tooling. No schema compiler step, no generated client to commit, no extension requirement before you can ship. Prisma and Drizzle both offer excellent tooling, but tsql is built around a different idea: your migration files are already enough.

If you're coming from SQLC: that mindset is the closest to tsql (typed SQL, explicit control), but SQLC's TypeScript experience is still much weaker than its Go-first flow.

Tooling philosophy

Fewer buttons to click. That is the feature.

Runtime portability

tsql separates query compilation from query execution, so it can fit:

The core idea stays the same: one migration history, one typed schema, many runtimes.

At its core, tsql is a context-aware string builder. It does not care how the SQL is executed.