// the find
sqorn/sqorn
A Javascript library for building SQL queries
Sqorn is a PostgreSQL query builder for Node.js built around tagged template literals. The API is genuinely clever — template literals handle parameterization automatically, and queries compose by chaining or embedding subqueries. It targets developers who want SQL control without string concatenation gymnastics.
Tagged template literals make parameterized queries feel natural — you write `where age < ${13}` and get a proper $1 placeholder without thinking about it. The monorepo structure cleanly separates dialect, adapter, and builder concerns. Query composition via `.extend()` and subquery embedding is well thought out — you can build complex SELECTs from parts without fighting the abstraction. The benchmarks show real work went into the build pipeline: 10x faster than Knex is plausible for a query builder that avoids object allocation overhead.
Last push was February 2023 and the original author handed it off to @gadgetinc — activity since then is minimal and the MySQL/SQLite/MSSQL adapters are stub packages with empty implementations, so Postgres-only is the honest description. TypeScript types exist but are incomplete; the `.d.ts` files cover basic cases and fall apart on complex compositions. No migration tooling, no schema introspection, no relation helpers — you're on your own for anything beyond raw query building. With Knex still actively maintained and Drizzle now offering type-safe SQL with similar composition patterns, adopting Sqorn in 2025 means betting on an effectively unmaintained library.