Fork me on GitHub
#sql
<
2017-11-21
>
borkdude13:11:30

Does hugsql support DEFAULT as in:

INSERT INTO films VALUES
    ('UA502', 'Bananas', 105, DEFAULT, 'Comedy', '82 minutes');
while also being able to provide a non-default value — so to provide something like :default as an argument

itaied17:11:50

Hello, wanted to hear your opinions on honeysql and yesql. I want to build a small web app on top of a RDBMS and I wonder how should I handle the queries. Any thoughts or past experience?

donaldball18:11:43

I prefer honeysql, but the choice really kind of boils down to: if you like expressing queries as manipulable data structures, e.g. for dynamic query construction, you’ll probably like the former. If you prefer to treat your sql queries as named parameterized strings, you’ll have a good time with the latter. (This isn’t strictly fair since yesql and hugsql do apparently offer some support for query fragments and composition, but I think it’s a decent synopsis of their philosophies.)

seancorfield18:11:28

@itaied We use HoneySQL very heavily -- in fact, one of my former colleagues gave a talk at Clojure/West about it (search for Fumiko Hanreich HoneySQL) -- but that's because we wanted composable queries built up dynamically as part of our custom reporting engine. We also use HoneySQL for composable queries elsewhere in our app. But for most simple queries, we just use raw clojure.java.jdbc -- strings with ? for parameters.

kardan18:11:38

@itaied we have landed in something similar as @seancorfield HoneySQL for most things and clojure.java.jdbc for simper stuff (http://github.com/akvo/akvo-lumen)

danielcompton19:11:48

@donaldball I think that's a pretty fair assessment, doing query fragments with yesql/hugsql isn't as pleasant as a Clojure DSL