Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Clojure
  3. honeysql

honeysql

NOASSERTIONClojurev2.8.85

A Clojure library that turns data structures into SQL queries, enabling programmatic SQL generation without string concatenation.

Visit WebsiteGitHubGitHub
1.9k stars181 forks0 contributors

What is honeysql?

HoneySQL is a Clojure library that converts Clojure data structures into SQL queries. It solves the problem of building SQL programmatically by providing a composable DSL, eliminating the need for error-prone string concatenation and enabling dynamic query construction at runtime.

Target Audience

Clojure and ClojureScript developers who need to generate SQL queries for databases, especially those using JDBC libraries like next.jdbc or clojure.java.jdbc and requiring dynamic or complex query building.

Value Proposition

Developers choose HoneySQL for its pure data structure approach, which integrates naturally with Clojure, supports multiple SQL dialects, and allows for extensibility without runtime dependencies. Its helper functions and parameterization options make it both safe and flexible for production use.

Overview

Turn Clojure data structures into SQL

Use Cases

Best For

  • Building dynamic SQL queries with conditional logic in Clojure applications
  • Generating safe, parameterized SQL for JDBC libraries like next.jdbc
  • Supporting multiple SQL dialects (e.g., PostgreSQL, MySQL) in a single codebase
  • Creating complex queries with nested subqueries and joins programmatically
  • Extending SQL syntax with custom operators or database-specific features
  • Writing SQL in ClojureScript or Babashka environments

Not Ideal For

  • Projects requiring a full-featured ORM with automatic schema migrations and object-relational mapping
  • Teams not using Clojure or ClojureScript who need SQL generation in other programming languages
  • Applications that need built-in database connection pooling, transaction management, or query execution
  • Simple, static SQL queries where raw string concatenation is sufficient and avoids library overhead

Pros & Cons

Pros

Data Structure DSL

Represents SQL queries as Clojure maps and vectors, making them composable and easy to manipulate programmatically, as shown with examples like {:select [:a :b :c] :from [:foo]}.

Multi-Dialect Support

Supports ANSI, MySQL, Oracle, SQLServer, and NRQL dialects out-of-the-box, with vendor-specific extensions, enabling cross-database compatibility without code changes.

Parameterized Safety

Generates SQL with positional (?) or numbered ($1) parameters to prevent SQL injection, seamlessly integrating with JDBC libraries like next.jdbc.

Extensible Syntax

Allows registration of custom operators, functions, and SQL clauses via register-op! and register-fn!, supporting database-specific features without modifying core library.

Cons

No Query Execution

HoneySQL is purely a SQL generation library and does not handle database connections or query execution, requiring additional dependencies like next.jdbc or clojure.java.jdbc.

Clojure Ecosystem Lock-in

Only usable within Clojure or ClojureScript projects, making it irrelevant for teams using other languages and adding a learning curve for non-Clojure developers.

Helper Function Conflicts

The honey.sql.helpers namespace overwrites several clojure.core functions (e.g., distinct, filter), which can cause naming conflicts and require careful namespace management, as noted in the README.

Non-Semantic Versioning

Uses a MAJOR.MINOR.COMMITS version scheme that does not follow semantic versioning, potentially leading to breaking changes in minor updates and reduced predictability for upgrades.

Frequently Asked Questions

Quick Stats

Stars1,928
Forks181
Contributors0
Open Issues2
Last commit2 days ago
CreatedSince 2012

Tags

#query-builder#database#clojurescript#parameterized-queries#dsl#babashka#sql-dialects#clojure#jdbc#sql-generation

Built With

C
Clojure
C
ClojureScript
B
Babashka

Links & Resources

Website

Included in

Clojure2.8k
Auto-fetched 1 day ago

Related Projects

KormaKorma

Tasty SQL for Clojure.

Stars1,467
Forks215
Last commit6 years ago
ToucanToucan

A classy high-level Clojure library for defining application models and retrieving them from a DB

Stars575
Forks48
Last commit3 years ago
WalkableWalkable

A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind

Stars453
Forks14
Last commit4 years ago
sqlingvosqlingvo

A Clojure & ClojureScript DSL for SQL

Stars210
Forks23
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub