[ANN] 0.3.0 HugSQL release

131 views
Skip to first unread message

Curtis Summers

unread,
Nov 11, 2015, 7:51:43 PM11/11/15
to Clojure
I'm happy to announce the 0.3.0 release of HugSQL.

HugSQL is a Clojure library for embracing SQL in your projects.

This is a significant release because of the new documentation site:  


Recent changes from 0.2.x to 0.3.0 include:
  • New doc site!
  • Comparison to Yesql (on doc site) - this was requested by many
  • Example application as source for doc examples (The Princess Bride themed!)
  • Tuple List Parameter Type for multi-record insert support
  • Pass-through options to the underlying database library (e.g., :as-arrays?)
  • Defer adapter selection as late as possible
  • Added on-exception to HugsqlAdapter protocol to allow implementations to redirect exceptions (helps with usage in core.async channels)
  • Error checks for sql file existence, parameter mismatch errors
  • Minor bug fixes
I'd like to give special thanks to Robin Heggelund Hansen, who jumped in early on filing issues, writing code, and making good suggestions for this very new project.  Robin is also the author of the HugSQL Adapter for postgres.async.

What is HugSQL?  HugSQL...
  • takes the position that SQL is the right tool for the job when working with a relational database.
  • uses simple conventions in your SQL files to define (at compile time) database functions in your Clojure namespace, creating a clean separation of Clojure and SQL code.
  • supports run-time replacement of SQL Value Parameters (e.g., where id = :id), SQL Identifiers (i.e. table/column names), and SQL Keywords. You can also implement your own parameter types.
  • has protocol-based adapters supporting multiple database libraries and ships with adapters for clojure.java.jdbc (default) and clojure.jdbc

Thanks!

Curtis Summers

Colin Yates

unread,
Nov 11, 2015, 9:10:06 PM11/11/15
to clo...@googlegroups.com
Congrats Curtis - this looks great.

I do have one question: you compare in http://www.hugsql.org/#faq-dsls HugSQL with HoneySQL, however, the one killer feature that I use HoneySQL for is composable queries - or rather building up the Clojure data map through composition before rendering it as SQL. Is there an equivalent capability in HugSQL? 

As a trivial example, I need to be able to add joins to the query in response to the filters the user passes through. Equally, I will apply a “top X” if the user has specified that in their request and so on. 

Please don’t read this as ‘Honey SQL can do this, you can’t na na nana na’ :-) It isn’t, simply asking for clarity as that comment in the page bought the two into comparison.

Thanks, and again, congratulations!

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Curtis Summers

unread,
Nov 11, 2015, 9:57:47 PM11/11/15
to clo...@googlegroups.com
Colin,

This is a great question, and I concede that the compose-ability of HoneySQL (and other DSLs) is almost always going to best HugSQL for the simple reason that a Lisp is a better tool for composing than SQL is.

You could feasibly accomplish some composable queries by using HugSQL's Raw SQL parameter type.  That seems a bit clunky to me at scale, and I'm not sure I'd recommend it.

HugSQL is a month old, and I'm open to adding additional features that would improve HugSQL's composable abilities.  This might include something like SQL snippet functions and snippet parameter types.  All feedback is welcome!

Thanks,

Curtis



You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/1vezOq3Ro78/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Robin Heggelund Hansen

unread,
Nov 12, 2015, 12:40:18 AM11/12/15
to Clojure
Fantastic release Curtis. This is an awesome work!

Curtis Summers

unread,
Nov 12, 2015, 9:26:49 AM11/12/15
to clo...@googlegroups.com
Colin,

I've added an issue to explore composable features for a future HugSQL release:


All ideas welcome!  Thanks!

On Wed, Nov 11, 2015 at 11:40 PM, Robin Heggelund Hansen <skinn...@gmail.com> wrote:
Fantastic release Curtis. This is an awesome work!

--
Reply all
Reply to author
Forward
0 new messages