Closed devurandom closed 12 months ago
The qualifiers are based on the table name that the JDBC driver provides for the columns. When you alias a column to a new name, several (most?) JDBC drivers retain the table name. When you alias a computed expression to a name, the drivers provide a blank table name, i.e., no qualifier. next.jdbc
is just acting as a thin wrapper around JDBC here -- it only knows about what comes back from the driver, not what went into the database.
Describe the bug
jdbc/execute!
unexpectedly qualifies column names that were explicitly unqualified usingSELECT ... AS ...
.To Reproduce
This HoneySQL:
Generates this SQL:
When I
jdbc/execute!
that, I get the following shape back:Expected behavior
I explicitly renamed
tab.other_field
toother
usingAS
, i.e. to something that was not qualified with the table name, so I would expect the map returned by next-jdbc to respect my choice.I would expect
tab.other_field
to end up in the same way thattab.one_field
does, which was also renamed usingAS
.Environment (please complete the following information):