kura_driver_pgo (kura_postgres v0.4.3)
View SourcePostgreSQL driver impl using pgo.
Wraps pgo's query/3 and query/4 and pgo's transaction/2 behind
the kura_driver behaviour so kura code does not need to know which
client library is in use.
Transaction context
pgo stashes the in-flight transaction conn in the process dict
(pgo_transaction_connection). query/5 checks for it: if present,
the query routes to the transaction conn via pgo:query/3 (pool
key); if absent, the query leases a fresh conn via kura_pool and
runs it caller-driven via pgo:query/4. Same shape as the previous
hardcoded path in kura_db:query/3 — extracted into a driver impl
so non-pgo drivers can substitute their own transaction conventions.
Summary
Functions
-spec probe_pool(kura_pool:name()) -> ok | {error, term()}.
-spec query_on(kura_pool:conn(), iodata(), [term()], map()) -> dynamic().
-spec transaction(module(), kura_pool:name(), fun(() -> term()), map()) -> term().