Liking cljdoc? Tell your friends :D

wagoe.platform.database

Executing queries against a configured database — platform's data-access API.

The sanctioned surface for every module's persistence layer. Modules used to require wagoe.platform.shell.adapters.database.common.core instead, which is platform's shell: 20 sites across tenant, user, admin, workflow and devtools reaching into another module's internals, carried as the largest entry in .wagoe/check-ports.edn (BOU-303).

Deliberately narrower than what it delegates to. Connection-pool lifecycle, raw SQL formatting and adapter construction stay internal — a module needs to run a query, not to build a pool. wagoe.platform.ports.database is the other half: what an adapter must implement.

Not a protocol, and that is the point. There is one way to execute a HoneySQL map against a JDBC connection, and the differences between engines live behind the DBAdapter port. A second protocol here would name a seam nothing implements — the mistake ADR-037 removed.

Executing queries against a configured database — platform's data-access API.

The sanctioned surface for every module's persistence layer. Modules used to
require `wagoe.platform.shell.adapters.database.common.core` instead, which
is platform's shell: 20 sites across tenant, user, admin, workflow and
devtools reaching into another module's internals, carried as the largest
entry in `.wagoe/check-ports.edn` (BOU-303).

Deliberately narrower than what it delegates to. Connection-pool lifecycle,
raw SQL formatting and adapter construction stay internal — a module needs
to run a query, not to build a pool. `wagoe.platform.ports.database` is the
other half: what an adapter must implement.

Not a protocol, and that is the point. There is one way to execute a
HoneySQL map against a JDBC connection, and the differences between engines
live behind the `DBAdapter` port. A second protocol here would name a seam
nothing implements — the mistake ADR-037 removed.
raw docstring

build-orderingclj

source

build-paginationclj

source

build-where-clauseclj

source

create-index-if-not-exists!clj

Create an index unless it is already there.

Create an index unless it is already there.
sourceraw docstring

database-infoclj

Engine, version and connection details for this context.

Engine, version and connection details for this context.
sourceraw docstring

db-context?clj

Whether x is a database context this namespace can use.

Whether `x` is a database context this namespace can use.
sourceraw docstring

execute-batch!clj

Run one statement over many parameter sets.

Run one statement over many parameter sets.
sourceraw docstring

execute-ddl!clj

Run a DDL statement.

Run a DDL statement.
sourceraw docstring

execute-one!clj

Run a query and return the first row, or nil.

Run a query and return the first row, or nil.
sourceraw docstring

execute-query!clj

Run a query and return every row.

Run a query and return every row.
sourceraw docstring

execute-update!clj

Run an insert/update/delete. Returns the update count.

Run an insert/update/delete. Returns the update count.
sourceraw docstring

get-active-db-configclj

The database configuration the application is running on.

Published because tenant provisioning needs it to open a connection to a second database — the one case where a module legitimately asks what it is connected to.

The database configuration the application is running on.

Published because tenant provisioning needs it to open a connection to a
second database — the one case where a module legitimately asks what it is
connected to.
sourceraw docstring

get-table-infoclj

Column metadata for table.

Column metadata for `table`.
sourceraw docstring

initialize-tables-from-schemas!clj

Create the tables described by a collection of Malli schemas, if absent.

Create the tables described by a collection of Malli schemas, if absent.
sourceraw docstring

list-tablesclj

Every table name in this database.

Every table name in this database.
sourceraw docstring

table-exists?clj

Whether table exists in this database.

Whether `table` exists in this database.
sourceraw docstring

with-transactioncljmacro

(with-transaction binding & body)

Run body in a transaction, bound to the first name in binding.

(with-transaction [tx ctx] (execute-update! tx query1) (execute-update! tx query2))

Run `body` in a transaction, bound to the first name in `binding`.

(with-transaction [tx ctx]
  (execute-update! tx query1)
  (execute-update! tx query2))
sourceraw docstring

with-transaction*clj

Call f with a transaction context, committing or rolling back around it.

Call `f` with a transaction context, committing or rolling back around it.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close