Ok, Iβll take a look.
Would a vector of numbers be interpreted as a function call? Or is it keyword/symbol first element?
The numbers would be treated as parameters and the vector would be rendered as a SQL tuple β but it would still be wrong π
i'm using next.jdbc
with hikari and postgres and i'm having what looks like some timezone related problems - is there any way to set the connection timezone for connections gotten via the pool ? HikariConfig.setConnectionInitSql
seems ideal, but i'm not even creating a HikariConfig
object, just (connection/->pool HikariDataSource db-spec)
@mccraigmccraig for Postgres you can always just .execute
SET SESSION TIMEZONE TO 'US/Pacific';
You could wrap the DataSource
you pass to Hikari and have it do that in getConnection
when it creates new connections to add to the poole.g. something like
(defn wrapped-data-source ^javax.sql.DataSource [^javax.sql.DataSource original-data-source]
(reify javax.sql.DataSource
(getConnection [_]
(let [conn (.getConnection original-data-source)]
(try
(with-open [stmt (.createStatement conn)]
(.executeUpdate stmt "SET SESSION TIME ZONE 'US/Pacific';"))
(catch Throwable e
(.close conn)
(throw e)))
conn))))
that works for me locally with Postgres + C3P0 at least.
good idea, thanks @camsaul
given up, just forced the JVM to UTC, which matches all our production stuff anyway
See https://github.com/seancorfield/next-jdbc/issues/138 β thatβs why jdbc-url
got added (but thereβs a bug affecting SQL Server usage right now β already fixed on develop but not released).
ah, ok, that makes sense
HikariCP has some weird blind spots. Like: using username
instead of user
β even though all the JDBC drivers use user
π
(and c3p0 uses user
)
π thanks @seancorfield