Fork me on GitHub
#honeysql
<
2021-01-21
>
Nassin03:01:24

What would be the structure for from weather w, cities c ....?

seancorfield03:01:26

@kaxaw75836 are you using the helper functions or just the raw data structure?

seancorfield03:01:54

In general with HoneySQL, if :foo is a SQL entity then [:foo :bar] is a SQL entity with an alias.

Nassin03:01:34

:from [:foo :bar :baz :bat] produces from foo, bar, baz, bat

Nassin03:01:59

I see what you mean [[:foo :bar] [:baz :bat]] thx!

Nassin03:01:26

missed it cause I was ignoring the "vanilla helpers" in the docs

seancorfield03:01:24

I prefer the helpers. I wish more people used them.

seancorfield03:01:49

It's really hard to get the raw data structures right. The helpers... well... help.

Nassin04:01:55

noted, you use it for all your queries or just dynamic ones?

seancorfield04:01:02

Just dynamic ones. We don't use HoneySQL for static queries. And we only use the helpers, not the raw data structure. And we're heavy users of HoneySQL -- one of my colleagues did a Clojure/West talk about it in 2015 (I think).

markaddleman04:01:16

fwiw, I code honey using the data structures directly. the only real problem is that, when i get something wrong, the resulting error message isn't terribly helpful but i can generally visually spot the problem in a minute or two of examining the data structure. i'm looking forward to honey 2.0 and spec. not only do i expect the error messages to get better, i think spec will make it easier to programmaticly manipulate queries.