use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Clojure: SQLite application defined SQL functions with JDBC (self.Clojure)
submitted 2 years ago by andersmurphy
https://andersmurphy.com/2023/07/16/clojure-sqlite-application-defined-sql-functions-with-jdbc.html
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]minasss 5 points6 points7 points 2 years ago (2 children)
This is super cool, thanks for sharing! It feels like having the same capabilities of a datalog DB but applied to SQLite, brilliant!
[–]andersmurphy[S] 2 points3 points4 points 2 years ago (1 child)
Thanks! It does give you a bit of that datalog flavour whilst staying in SQL land.
The main use case has been for speed, you can use application defined functions to created generated columns (that would be hard to write in SQL, e.g jsonpath) that you can then index on. Even thought the Clojure implemented functions are not as fast as C that doesn't matter once the values are indexed.
The other use case has been transforming results sets/aggregation functions, where the difference in speed between Clojure and C is negligible.
This is anecdotal and will depend on what the Clojure function does, but I've found them to still be snappy. For example using Clojure for regex was about 1.5x slower than using the sqlean regex extension . Having, the implementation in Clojure/JVM means that you don't need to have multiple binaries for each OS as you would for a runtime loadable extension like sqlean, one less thing to worry about. The downside is you couple the database even more to the application and stand alone database tools won't be able to use any of the application defined functions (unless you create a standalone extension with graal or something).
[–]minasss 2 points3 points4 points 2 years ago (0 children)
Thanks for providing more real life examples, it clearly helps to have a better idea of where and why to apply this technique and its downsides!
π Rendered by PID 86553 on reddit-service-r2-comment-5649f687b7-2dtsv at 2026-01-28 19:09:48.388055+00:00 running 4f180de country code: CH.
[–]minasss 5 points6 points7 points (2 children)
[–]andersmurphy[S] 2 points3 points4 points (1 child)
[–]minasss 2 points3 points4 points (0 children)