sql

All things SQL and JDBC...
2021-05-08T11:04:19.156Z

Hello! I am looking at writing a query like this one https://stackoverflow.com/a/15710598/1327651 It seems easy enough with the helpers in next-jdbc like as-keys and by-keys. But if the values are not for strings but Dates/ZonedDateTime I would need to convert them myself? Or is there a way I can reuse the existing conversions? https://github.com/seancorfield/next-jdbc/blob/91dda2cdae3f9e897a54fe21edf8467acae8aa0d/doc/prepared-statements.md#prepared-statement-parameters Or should I look at calling eg. honeysql’s to-sql (I am using this dependency yet).

2021-05-08T12:10:20.156800Z

^I went with a custom to-sql protocol

seancorfield 2021-05-08T16:56:31.157500Z

@nha Did you read this section https://cljdoc.org/d/seancorfield/next.jdbc/1.1.613/doc/getting-started#working-with-additional-data-types and try next.jdbc.date-time?

2021-05-08T20:02:22.157700Z

I think I have dates working in other places using next.jdbc so that should be setup already, though I'll need to double check. Thanks!