It seems to me that it's a problem that sooner or later appears in any project using relational database (apart form easy cases, when there is no many relations between tables). Am I missing something? How do you guys work with database results of queries containing several tables referring to each other?
W dniu czwartek, 21 maja 2015 21:57:03 UTC+2 użytkownik Krzysiek Herod napisał: > > I've found the question appearing here, but a long time ago, so I thought > that maybe the situation changed: > > Is there a relational mapper in clojure (or in java) that takes query > result and generates an array of hashmaps? > I mean something that converts the result of this query: > "SELECT * FROM posts LEFT JOIN comments ON (comments.post_id = posts.id) > LEFT JOIN users ON (posts.user_id = users.id)" > into (for example) the following structure: > [{:title "Post title" :user {:first_name "User 1"} :comments [{:title > "Comment 1"} {:title "Comment 2"}]}] > > I've used kormadb for that, but it works like this only with has-many > relation (belongs-to puts all of the fields from related tables into the > same hash as if it was one table, and using "with" do not solve the problem > neither). > > Is there any other clojure library that does that, or is any java library > used instead? > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.