Liking cljdoc? Tell your friends :D

wagoe.platform.shell.database.seed

Loads a seed file into the active database.

The pure parts — validation, kebab->snake conversion, plan building — live in wagoe.platform.core.database.seed. This namespace owns the I/O: reading the file, acquiring the datasource, and executing the inserts.

Loads a seed file into the active database.

The pure parts — validation, kebab->snake conversion, plan building — live in
`wagoe.platform.core.database.seed`. This namespace owns the I/O: reading the
file, acquiring the datasource, and executing the inserts.
raw docstring

admin-missing?clj

(admin-missing? ds)

Whether an application with the user module has no admin: its users table is not there (a reset dropped it and nothing has booted since) or has no row with the admin role.

Whether an application with the user module has no admin: its users table
is not there (a reset dropped it and nothing has booted since) or has no row
with the admin role.
sourceraw docstring

default-seed-pathclj

source

hook-summaryclj

(hook-summary k result)

The lines the seeder prints for what hook k returned: a string or strings saying what it did (BOU-591). A hook that returns neither is named.

The lines the seeder prints for what hook `k` returned: a string or strings
saying what it did (BOU-591). A hook that returns neither is named.
sourceraw docstring

read-seed-fileclj

(read-seed-file path)

Reads and parses a seed file.

Returns {:ok data}, or {:error {...}} when the file is missing or is not readable EDN. A malformed seed file is a user-facing mistake, so the parse failure is caught here and turned into a value rather than a stack trace.

Reads and parses a seed file.

Returns `{:ok data}`, or `{:error {...}}` when the file is missing or is not
readable EDN. A malformed seed file is a user-facing mistake, so the parse
failure is caught here and turned into a value rather than a stack trace.
sourceraw docstring

run-seed!clj

(run-seed!)
(run-seed! path)

Reads path and seeds the active database with it.

Returns {:ok {:tables n :rows n :detail [...] :admin-missing? bool}} or {:error {...}}.

Reads `path` and seeds the active database with it.

Returns `{:ok {:tables n :rows n :detail [...] :admin-missing? bool}}` or
`{:error {...}}`.
sourceraw docstring

run-seed-hooks!clj

(run-seed-hooks! system-ns inserted)

Hand inserted — {table-name rows} — to the application's seed hooks: the components of its system that derive from :wagoe/seed-hook. Only those, and what they depend on, are started, and they are halted again. A generated module's is how a seeded row with a workflow gets one (BOU-578).

system-ns is the application's system-config namespace: its ig-config, and its load-config when it has one. Returns what the hooks did, as lines to print (see hook-summary).

Hand `inserted` — {table-name rows} — to the application's seed hooks: the
components of its system that derive from :wagoe/seed-hook. Only those, and
what they depend on, are started, and they are halted again. A generated
module's is how a seeded row with a workflow gets one (BOU-578).

`system-ns` is the application's system-config namespace: its `ig-config`,
and its `load-config` when it has one. Returns what the hooks did, as lines
to print (see `hook-summary`).
sourceraw docstring

seed!clj

(seed! ds data)

Insert data, validated, into ds in one transaction, its symbolic ids resolved and its defaults filled in against the tables as they are.

All-or-nothing on purpose: a half-applied seed leaves a database that looks populated but is not, which is harder to notice than an outright failure.

Returns {:ok {:tables n :rows n :detail [...] :inserted {...}}} or {:error {...}}.

Insert `data`, validated, into `ds` in one transaction, its symbolic ids
resolved and its defaults filled in against the tables as they are.

All-or-nothing on purpose: a half-applied seed leaves a database that looks
populated but is not, which is harder to notice than an outright failure.

Returns `{:ok {:tables n :rows n :detail [...] :inserted {...}}}` or
`{:error {...}}`.
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