Curious to hear if anyone uses yesql or similar[1]. I'd really be interested in hearing from someone who has used Honey SQL and yesql and can compare/contrast. After dealing with ActiveRecord for the past few years, I'm ready to just be able to write plain old SQL again. It seems like yesql is a pretty sweet solution, but I haven't tried it in earnest. [1] https://github.com/krisajenkins/yesql
Honey SQL – SQL as Clojure data structures
21–30 of 31 posts
Re: Honey SQL – SQL as Clojure data structures
#22Does anything comparable exists for Python?
Re: Honey SQL – SQL as Clojure data structures
#23Curious to hear if anyone uses yesql or similar[1]. I'd really be interested in hearing from someone who has used Honey SQL and yesql and can compare/contrast. After dealing with ActiveRecord for the past few years, I'm ready to just be able to write plain old SQL again. It seems like yesql is a pretty sweet solution, but I haven't tried it in earnest. [1] https://github.com/krisajenkins/yesql
I've found templated queries(e.g. yesql) are far preferable for complex selects/joins/subselects and just can't imagine using the data structure dsl for such queries. One huge downside of dsl queries is that they NEVER support the full sql syntax of any database, in my case postgres. The best part is being able to write the query in a sql editor then copy/paste directly, rather than needing to translate into a dsl. O…
I work with lots of CTEs, UNIONS, JOINS, and sub-selects and can't imagine not using data structures to validate individual parts of the query as I'm designing it. Particularly given how trivial it is in HoneySQL (anywhere a sub-select is legal you can insert a HoneySQL query map).
Further, I use a lot of the jsonb and postgis features of Postgres and HoneySQL is a champ here. Not everything is supported out of the box[0], but adding any missing clause or operator is just a quick defmethod away. Between HoneySQL and clojure.java.jdbc, working with PostgreSQL's JSON support feels like Mongo with the added abilities of custom types, transactions, and function indexes.
I do have a limit with how far I'll take HoneySQL, but that limit is usually something that belongs in a trigger or a sproc anyway.
[0] honeysql-postgres (https://github.com/nilenso/honeysql-postgres) helps here by providing some postgres-specific clauses/operators.
Re: Honey SQL – SQL as Clojure data structures
#24Curious to hear if anyone uses yesql or similar[1]. I'd really be interested in hearing from someone who has used Honey SQL and yesql and can compare/contrast. After dealing with ActiveRecord for the past few years, I'm ready to just be able to write plain old SQL again. It seems like yesql is a pretty sweet solution, but I haven't tried it in earnest. [1] https://github.com/krisajenkins/yesql
Re: Honey SQL – SQL as Clojure data structures
#25Curious to hear if anyone uses yesql or similar[1]. I'd really be interested in hearing from someone who has used Honey SQL and yesql and can compare/contrast. After dealing with ActiveRecord for the past few years, I'm ready to just be able to write plain old SQL again. It seems like yesql is a pretty sweet solution, but I haven't tried it in earnest. [1] https://github.com/krisajenkins/yesql
Re: Honey SQL – SQL as Clojure data structures
#26Re: Honey SQL – SQL as Clojure data structures
#27isn't this just korma?
The documentation isn't really great, and when falling out of the most vanilla use cases, you need to fire up Google and pray to find posts from someone with a similar problem, or go read the code, which always takes more time. I ended up several times using "raw" and writing big queries in a string, as I desisted to fight against the library. I'm planning on porting everything to either honeysql or yesql whenever I have time.
In my opinion, korma was a good experiment from earlier clojure times, but the approach it takes ends up suboptimal. Honeysql's approach seems more lean and more integrated into the core language, so it is easier to operate (disclaimer: I did not test it yet).
Re: Honey SQL – SQL as Clojure data structures
#28Curious to hear if anyone uses yesql or similar[1]. I'd really be interested in hearing from someone who has used Honey SQL and yesql and can compare/contrast. After dealing with ActiveRecord for the past few years, I'm ready to just be able to write plain old SQL again. It seems like yesql is a pretty sweet solution, but I haven't tried it in earnest. [1] https://github.com/krisajenkins/yesql
https://github.com/bschwind/api-starter-kit/tree/master/apps...
EDIT: Actually I think the goal if I was to add more complex queries would be to use HugSQL for static, templated queries, and HoneySQL for highly dynamic queries that need conditions added or altered depending on input from other sources.
Re: Honey SQL – SQL as Clojure data structures
#29Re: Honey SQL – SQL as Clojure data structures
#30Queries are plain clj maps and there is also a thin dsl provided.
https://github.com/mpenet/hayt
In our case we use it to generate prepared statements but we avoid using this kind of query gen on live/hot paths.