mirror of
https://github.com/penpot/penpot.git
synced 2026-04-27 04:08:23 +00:00
✨ Add the ability to check read-only state of connection
on the db ns helper; previously it only worked with datasource instances
This commit is contained in:
parent
d5bbc7b1aa
commit
90d48c1d30
@ -155,8 +155,18 @@
|
||||
(.isClosed ^HikariDataSource pool))
|
||||
|
||||
(defn read-only?
|
||||
[pool]
|
||||
(.isReadOnly ^HikariDataSource pool))
|
||||
[pool-or-conn]
|
||||
(cond
|
||||
(instance? HikariDataSource pool-or-conn)
|
||||
(.isReadOnly ^HikariDataSource pool-or-conn)
|
||||
|
||||
(instance? Connection pool-or-conn)
|
||||
(.isReadOnly ^Connection pool-or-conn)
|
||||
|
||||
:else
|
||||
(ex/raise :type :internal
|
||||
:code :invalid-connection
|
||||
:hint "invalid connection provided")))
|
||||
|
||||
(defn create-pool
|
||||
[cfg]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user