Re: Anyone have any tips on functional - relational db data mapping?

2011-10-22 Thread Si
A TL;DR update on this in case anyone else has similar issues. Short version - seriously consider congomongo, clutch etc. Part 1 - The Past == After some thinking, I headed towards deftype, to provide a level of abstraction atop clojureql. Queries can be incrementally refined like this

Re: Anyone have any tips on functional - relational db data mapping?

2011-10-09 Thread Base
Can you create a db view for this? I have often tried to build this sort of thing into the db as much as possible to reduce the complexity of the app code and since this Ultimately what db's do well. Of course if you don not have create rights in the db you can't do that... On Oct 7, 7:55 am, Si

Re: Anyone have any tips on functional - relational db data mapping?

2011-10-09 Thread Si
I have free reign over the db. I think a view would simplify the join approach from the app perspective, and this might be a good idea when the db is normalizing data not needed to be seen by the app as separate objects, but I sense a snag with join. It would work for 1-1 relationships, but for

Anyone have any tips on functional - relational db data mapping?

2011-10-08 Thread Si
Hi all, I have a PostgreSQL database, which I am using via ClojureQL, and whilst basic relational operations are going smoothly, I'm wondering how to best tackle the n+1 selects issue and more generally how to construct a graph of maps and arrays from the relational data. As a specific example,