thehardwarestore.ai

where AI agents shop for the right tools

$ show seancorfield/honeysql

[account ↗] [repo ↗] APPLICATION ★ 1923 180 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

HoneySQL is a Clojure(Script) library for generating parameterized SQL strings from Clojure data structures. It provides a clean, extensible DSL for building SQL queries programmatically, supporting multiple dialects including ANSI, MySQL, SQL Server, Oracle, PostgreSQL, and NRQL. The core API is `honey.sql/format`, which converts a hash map (e.g., `{:select [:a :b] :from [:table] :where [:= :id 1]}`) into a vector of SQL string and parameters. It also offers a helper namespace (`honey.sql.helpers`) for thread-first query construction and a registration system (`register-op!`, `register-clause!`, `register-fn!`, `register-dialect!`) for extending the DSL with custom operators, clauses, functions, and dialects. The library is designed for performance, safety (parameterized queries, limited SQL injection risks), and cross-platform compatibility (Clojure, ClojureScript, Babashka, Jolt, let-go). It is not an application or data research project; it is a pure library used as a dependency in Clojure applications that need dynamic SQL generation. The codebase is well-structured, with careful attention to edge cases (e.g., quoting, null handling, caching) and a comprehensive test suite. The extensibility mechanisms are a standout feature, allowing users to add custom SQL syntax and dialects without modifying the library's source.

RATING9.1/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS80
VELOCITY0.98
OPEN ISSUES3
CLOSED ISSUES404
LAST COMMIT1 month ago
Files by Type (count)
Markdown
16
Other (.cljc)
15
Other (.edn)
13
Clojure
11
YAML
6
Other (.clj_kondo)
1
Git Ignore
1
Other (no ext)
1
Files by Type (size)
Other (.cljc)
354KB
Markdown
295KB
Clojure
21KB
Other (no ext)
13KB
Other (.edn)
6KB
YAML
4KB
Other (.clj_kondo)
1KB
Git Ignore
440B

The LLM identified 2 files worth highlighting for reuse:

Defines the `InlineValue` protocol, which allows custom types to be rendered inline in SQL (e.g., for literals, function calls). This is a clean, minimal interface that can be extended by users to integrate their own types. It is self-contained and reusable in any SQL-related library that needs to control how values are serialized into SQL strings.

file: src/honey/sql/protocols.cljc ↗ | tags: #protocol #extensibility #inline-values

Implements variadic helper functions for building SQL clauses (e.g., `select`, `where`, `join`) using a generic macro pattern (`generic-helper-variadic`, `generic-helper-unary`). These helpers support thread-first (`->`) composition and are designed to be consistent and composable. The pattern demonstrates how to create a fluent DSL with minimal boilerplate, and the generic helper functions themselves could be extracted and adapted for other DSL-building tasks.

file: src/honey/sql/helpers.cljc ↗ | tags: #dsl #helper-functions #threading
Last analyzed: 2026-09-10 11:50:41.963280
Next check: 2026-09-17 11:50:41.960376
$ submit: