This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-27
Channels
- # announcements (1)
- # aws (17)
- # babashka (2)
- # beginners (14)
- # calva (1)
- # cider (16)
- # clara (1)
- # clj-kondo (68)
- # cljdoc (2)
- # clojure (51)
- # clojure-dev (1)
- # clojure-italy (2)
- # clojure-spec (1)
- # clojure-uk (19)
- # clojurescript (34)
- # cursive (4)
- # fulcro (1)
- # heroku (3)
- # leiningen (36)
- # lumo (28)
- # music (2)
- # off-topic (16)
- # reagent (22)
- # specter (7)
- # sql (7)
Using honeysql and sqlite: If I do a (select :*) (from :a) where :a has column 'name', and then join two more tables each with a 'name' column, I get name_1 name_2 name_3 in the result map. Am I guranteed that name_3 is from the third table (second join table)?
That's done inside clojure.java.jdbc
. I'd have to check the source code to see whether you can rely on the order but I would advise not relying on that order.
next.jdbc
does not attempt to make columns unique like this -- but the default behavior is to make qualified column names using the table name (if available) for each column.
Ok so I guess I need to manually name the resulting columns and include every column I want explicitly in the select clause.
Just looked, the columns are processed in order, based on how they come back in the JDBC ResultSet
object -- so you're guaranteed ordering if that is part of the JDBC spec I suppose (I have no idea whether it is).
You could try using next.jdbc
and work with qualified column names instead -- that would make it unambiguous.
(I have no plans to work on clojure.java.jdbc
in future, except for fixing show stopping bugs, so next.jdbc
is where all active development is now)