bisql (báisikl)
Executable SQL as Clojure functions, with generated CRUD queries and SQL-first development.
- Query templates remain valid, executable SQL.
- Typical index-friendly queries are generated automatically, as comprehensively as possible.
No query builder
No data mapper
No hidden SQL
No boilerplate SQL
Start a database, run the generation commands, add (defquery), and you can immediately call query functions from your Clojure code. Every function still corresponds to real SQL.
Note
This project is still early and the API may change. Support for databases beyond PostgreSQL and Malli integration are both planned.
The full Getting Started guide lives here:
The full Installation guide lives here:
- Generated CRUD SQL carries
:malli/inand:malli/outdeclaration metadata. - When generated query functions keep
:malli/inand:malli/outmetadata, Bisql can run Malli validation transparently during query execution.
The full guide lives here:
See the end-to-end sample project here:
It shows a practical flow:
- generate CRUD SQL from a PostgreSQL schema
- generate matching function namespace files
- execute one generated query
- copy one generated query into a hand-written SQL template
- execute the customized query
For local setup, tasks, and dev workflow, see:
- ✅️
Support a very small expression language to improve expressiveness inifconditions. - ✅️
Add Malli integration. - Split Malli validation dependencies out from the main runtime package.
- Add sentinels for SQL time literals such as
CURRENT_DATE,CURRENT_TIME, andCURRENT_TIMESTAMP. - Split the CLI into a separate package.
- Add
rewrite-cljas a CLI-side dependency and implement pruning for unused generated vars.
- Add
- Support databases beyond PostgreSQL.
- Compile analyzed SQL templates into reusable renderer functions for lower runtime overhead.
- Simplify emitted renderer forms further, especially around branch and loop body handling.
- Reduce helper calls in emitted code where fragment normalization is still delegated.
- Restrict
bisql/DEFAULTto valid SQL value contexts if context-aware rendering becomes necessary. - Detect dangerous
nilcomparisons consistently inWHERE/HAVINGclauses instead of letting expressions such as= NULL,LIKE NULL, orIN (NULL)silently behave unexpectedly. This likely needs stricter SQL context parsing, because= NULLis dangerous inWHERE/HAVINGbut can still be valid assignment syntax inSET.
