Fork me on GitHub
#sql
<
2020-10-16
>
Saikyun09:10:15

is it possible to get the columns in order/column order of a query? 🙂 since I get the data as hash maps I don't know how to retain column order.

seancorfield16:10:47

@saikyun If you ask for the results to come back as vectors, the columns (the first vector in the result) will be in natural order.

seancorfield16:10:28

If you're using next.jdbc, you can also call next.jdbc.result-set/get-column-names on a ResultSetMetaData object to get them in order (or any of its variants).

Saikyun10:10:00

thanks for the info 🙂

Saikyun10:10:13

that's exactly what I wanted

seancorfield16:10:26

(and if you're inside a reducing function operating on rows from plan you can call column-names on the row and get them)

borkdude21:10:05

People using SQL Server on Windows can now speak to it from babashka using a pod written in C#: https://github.com/xledger/pod_sql_server