Fork me on GitHub
Gleb Posobin14:12:16

Say I do a query like SELECT * FROM nodes n1 JOIN nodes n2 ON n1.parent_id =, next.jdbc assigns keys :nodes/* to all the fields, so I can't get all the fields from the result. What should I do? Is there a way to make jdbc assign keys in the :n1/ and :n2/ format?


@posobin Per the Getting Started docs: > If your SQL query joins a table to itself under different aliases, the qualified column names will conflict because they are based on the underlying table name provided by the JDBC driver rather the alias you used in your query -- again, use aliases in SQL to make those column names distinct. So you need to explicitly alias the columns you need to different names in this case.

Gleb Posobin18:12:10

I see, thank you!

seancorfield18:12:42 automatically renames conflicts for you -- but you have no control over which column is renamed and which is the original (not good). next.jdbc makes you do it explicitly. The underlying issue is that SQL/JDBC don't do anything to help you here since they happily allow duplicate columns in results.