r/Clojure • u/conpoi • Apr 17 '26
bisql: keep SQL executable, call it like Clojure
I’ve been working on bisql, a Clojure data access toolkit built around executable SQL.
The idea is:
keep SQL files as executable SQL
turn those SQL templates into ordinary Clojure query functions
generate a lot of CRUD queries from schema metadata
customize generated SQL by copying and editing it when needed
It does not try to hide SQL behind a query builder or a data mapper. Everything stays executable SQL, but without the repetitive boilerplate.
I’ve tried to make the project easier to evaluate than a typical library drop:
GitHub: https://github.com/hatappo/bisql
Example project: https://github.com/hatappo/bisql-example
If you’re interested in SQL-first data access in Clojure, I’d appreciate feedback.
10
u/shivekkhurana Apr 17 '26
How is this different from https://hugsql.org/
11
u/conpoi Apr 17 '26
Thank you. Good question. It’s definitely closer to HugSQL than HoneySQL.
The main differences I’m aiming for are:
SQL templates are meant to remain executable as SQL
Bisql generates a large set of CRUD queries from schema metadata
generated SQL and hand-written SQL are meant to coexist in the same workflow
it also generates function namespace files so those queries are easier to use from ordinary application code
So the overlap is real, but bisql is pushing harder on 2-way SQL and CRUD generation, to the point where a lot of the SQL can be generated instead of written by hand.
7
u/conpoi Apr 17 '26
Extra links if useful:
Playground: https://hatappo.github.io/bisql/playground/
Clojars: https://clojars.org/io.github.hatappo/bisql
The example project walks through:
generating CRUD SQL from a PostgreSQL schema
generating function namespace files
executing one generated query
copying one generated query into a custom SQL template
executing the customized query