(connection-pool-with-delayed-init config init-fn timeout)
(connection-pool-with-delayed-init config migration-options init-fn timeout)
Create a connection pool that loops trying to get a connection, and then runs init-fn (with the connection as argument) before returning any connections to the application. Accepts a timeout in ms that's used when deferencing the future. This overrides the value of initialization-fail-timeout to never timeout.
Create a connection pool that loops trying to get a connection, and then runs init-fn (with the connection as argument) before returning any connections to the application. Accepts a timeout in ms that's used when deferencing the future. This overrides the value of initialization-fail-timeout to never timeout.
(block-until-ready this)
(block-until-ready this timeout-ms)
Block execution until initialization is done, or the timeout expires (if specified). If the timeout is specified, returns true if the execution completed within the timeperiod, false if it didn't.
Block execution until initialization is done, or the timeout expires (if specified). If the timeout is specified, returns true if the execution completed within the timeperiod, false if it didn't.
(cancel-init this)
Attempt to cancel the async initialization. Returns true if it was cancelled, false otherwise
Attempt to cancel the async initialization. Returns true if it was cancelled, false otherwise
(close-after-ready this)
(close-after-ready this timeout-ms)
Wait for the init routine to complete and then close the datasource. If the timeout is specified and expires before the init is complete, cancel the init and close the datasource.
Wait for the init routine to complete and then close the datasource. If the timeout is specified and expires before the init is complete, cancel the init and close the datasource.
(init-complete? this)
Returns true if the init is complete, false otherwise
Returns true if the init is complete, false otherwise
(init-error this)
Return any exception raised by the init function (nil if none).
Return any exception raised by the init function (nil if none).
(status this)
Get a map representing the status of a connection pool.
Get a map representing the status of a connection pool.
(select-user-configurable-hikari-options m)
Given a map, return the subset of entries in the map whose keys are hikari options that we want our users to be able to configure. This is intended to allow users to set these fields in the database configuration section of a service's TrapperKeeper config.
Given a map, return the subset of entries in the map whose keys are hikari options that we want our users to be able to configure. This is intended to allow users to set these fields in the database configuration section of a service's TrapperKeeper config.
(wait-for-migrations db migration-dir)
Loops until there are no uncompleted migrations from the migration-dir in the db. We use this on pglogical replicas which will have their database migrations replicated.
Loops until there are no uncompleted migrations from the migration-dir in the db. We use this on pglogical replicas which will have their database migrations replicated.
(wrap-with-delayed-init datasource init-fn timeout)
(wrap-with-delayed-init datasource migration-opts init-fn timeout)
Wraps a connection pool that loops trying to get a connection, and then runs database migrations, then calls init-fn (with the connection as argument) before returning any connections to the application. Accepts a timeout in ms that's used when dereferencing the future and by the status check. The datasource should have initialization-fail-fast set before being created or this is pointless.
migration-opts is a map of: :migration-dir, the path to the migratus migration directory on the classpath :migration-dirs, the optional list of paths to any migratus migration directories :migration-db, the connection map for the db used for migrations :replication-mode, one of :source, :replica, or :none (the default)
If migration-opts is nil or not passed, the migration step is skipped.
Wraps a connection pool that loops trying to get a connection, and then runs database migrations, then calls init-fn (with the connection as argument) before returning any connections to the application. Accepts a timeout in ms that's used when dereferencing the future and by the status check. The datasource should have initialization-fail-fast set before being created or this is pointless. migration-opts is a map of: :migration-dir, the path to the migratus migration directory on the classpath :migration-dirs, the optional list of paths to any migratus migration directories :migration-db, the connection map for the db used for migrations :replication-mode, one of :source, :replica, or :none (the default) If migration-opts is nil or not passed, the migration step is skipped.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close