Fork me on GitHub
#sql
<
2016-08-04
>
sandbags09:08:01

Anyone have an example of a moderately complex (i.e. more than a toy but not a massively intertwingled app) use of HoneySQL?

sandbags09:08:24

i feel a bit like i am wandering around in the dark

donaldball12:08:10

Not that’s open source, sadly, but I’m happy to share my experiences / opinions if that’s at all helpful

sandbags15:08:53

At this point I don’t have a lot of specific questions rather a general sense that I don’t have a good mental model for how to think about managing persistent data via something like HoneySql when I get into more complex associations and I’d like to see a few examples I can work from.

sandbags15:08:06

but thank you for the offer, if I do have some specific scenarios or questions I will bring them

bja15:08:40

it largely depends on your use case. We have a few tables that are conditionally joined and make multiple uses of some tables (such that we often need different where clauses, and we don't know the exact query ahead of time)

bja15:08:27

sandbags: if you find yourself doing this: http://emidln.com/honeysql-talk/#/10

bja15:08:34

you probably want honeysql

sandbags15:08:02

@bja: i’m already using honeysql, but as i stray into managing the associations i’m looking at whether there is already a best practice

sandbags15:08:16

i’ve thrown out using records for entities

sandbags15:08:25

as it seems to make joined data unnecessarily complicated

bja15:08:05

I don't know if there is a best practice, but I find that cond-> results in easy to understand code

bja15:08:01

a lot of times we'll have something like (defnk find-domain-object ...) where optional parameters might build a set of various correlated subqueries

sandbags16:08:56

yeah i’ve built some stuff for creating obvious queries around a “model definition” map

sandbags16:08:44

i guess i will just muddle along and see what i come up with, i was just hoping to short-circuit that process

sandbags16:08:01

unfortunately i have very little time for dev stuff which makes progress difficult right now

bja16:08:56

plumbing.core/defnk

bja16:08:42

we tend to use that for query builder definitions as there are a ton of parameters and we'd like the runtime assertions

bja18:08:34

(sorry for that, wrong window)