Liking cljdoc? Tell your friends :D

us.whitford.fulcro.rad.database-adapters.datalevin

Datalevin database adapter for Fulcro RAD.

This namespace provides the main public API by re-exporting functions from the modular sub-namespaces. Import this namespace and use its functions to work with the Datalevin adapter.

Main functions:

  • start-databases: Start database connections
  • stop-databases: Stop database connections
  • pathom-plugin: Create a Pathom3 plugin for database access
  • generate-resolvers: Generate automatic resolvers for RAD attributes
  • wrap-datalevin-save: Middleware for saving forms
  • wrap-datalevin-delete: Middleware for deleting entities
  • automatic-schema: Generate Datalevin schema from RAD attributes
Datalevin database adapter for Fulcro RAD.

This namespace provides the main public API by re-exporting functions
from the modular sub-namespaces. Import this namespace and use its
functions to work with the Datalevin adapter.

Main functions:
- start-databases: Start database connections
- stop-databases: Stop database connections
- pathom-plugin: Create a Pathom3 plugin for database access
- generate-resolvers: Generate automatic resolvers for RAD attributes
- wrap-datalevin-save: Middleware for saving forms
- wrap-datalevin-delete: Middleware for deleting entities
- automatic-schema: Generate Datalevin schema from RAD attributes
raw docstring

append-to-raw-txnclj

Append native Datalevin transaction forms (e.g. [:db/ensure ...] post-conditions) to a save env. See wrap-datalevin-save/append-to-raw-txn.

Append native Datalevin transaction forms (e.g. `[:db/ensure ...]`
post-conditions) to a save env. See wrap-datalevin-save/append-to-raw-txn.
sourceraw docstring

automatic-schemaclj

source

datalevin-result->pathom-resultclj

Convert Datalevin result with :db/id to Pathom result with proper ID key.

Convert Datalevin result with :db/id to Pathom result with proper ID key.
sourceraw docstring

delta->txnclj

Convert RAD form delta to Datalevin transaction data.

Arguments:

  • env: environment map with ::attr/key->attribute
  • delta: RAD form delta map

Returns vector of Datalevin transaction operations.

Convert RAD form delta to Datalevin transaction data.

Arguments:
- env: environment map with ::attr/key->attribute
- delta: RAD form delta map

Returns vector of Datalevin transaction operations.
sourceraw docstring

ensure-schema!clj

source

generate-resolversclj

Generate all of the resolvers that make sense for the given database config.

Arguments:

  • attributes: collection of RAD attributes
  • schema: schema keyword (e.g., :main)

Returns Pathom-2-shape resolver maps (plain data). These work directly in a Pathom 2 parser and are auto-converted by RAD's Pathom 3 processor (new-processor runs convert-resolvers). No hard pathom dependency is required to build them. See generate-resolvers-pathom3 for native P3 records.

Generate all of the resolvers that make sense for the given database config.

Arguments:
- attributes: collection of RAD attributes
- schema: schema keyword (e.g., :main)

Returns Pathom-2-shape resolver maps (plain data). These work directly in a
Pathom 2 parser and are auto-converted by RAD's Pathom 3 processor
(`new-processor` runs `convert-resolvers`). No hard pathom dependency is
required to build them. See generate-resolvers-pathom3 for native P3 records.
sourceraw docstring

generate-resolvers-pathom3clj

Like generate-resolvers, but returns native Pathom 3 resolver records. Requires pathom3 on the classpath at call time (resolved lazily). Use only when building a Pathom 3 index directly rather than via RAD's new-processor.

Like `generate-resolvers`, but returns native Pathom 3 resolver records.
Requires pathom3 on the classpath at call time (resolved lazily). Use only
when building a Pathom 3 index directly rather than via RAD's new-processor.
sourceraw docstring

get-by-idsclj

source

keys-in-deltaclj

source

native-id?clj

Returns true if the given attribute uses native :db/id.

Returns true if the given attribute uses native :db/id.
sourceraw docstring

pathom-pluginclj

Pathom 2 plugin that injects Datalevin connections/databases into the parse env. For Pathom 3, use wrap-env instead. See datalevin.pathom-plugin.

Pathom 2 plugin that injects Datalevin connections/databases into the parse
env. For Pathom 3, use `wrap-env` instead. See datalevin.pathom-plugin.
sourceraw docstring

pathom-query->datalevin-queryclj

Convert a Pathom EQL query to a Datalevin pull pattern. Replaces native-id identity attributes with :db/id.

Convert a Pathom EQL query to a Datalevin pull pattern.
Replaces native-id identity attributes with :db/id.
sourceraw docstring

pullclj

source

pull-manyclj

source

qclj

source

save-form!clj

source

schema-problemsclj

Return a seq of problems comparing the RAD-derived expected schema against the live Datalevin schema of a connection. See start-databases/schema-problems.

Return a seq of problems comparing the RAD-derived expected schema against the
live Datalevin schema of a connection. See start-databases/schema-problems.
sourceraw docstring

schemas-for-deltaclj

source

seed-database!clj

source

start-database!clj

source

start-databasesclj

source

stop-database!clj

source

stop-databasesclj

source

verify-schema!clj

Throw when the live Datalevin schema does not satisfy the RAD-derived expected schema; returns true otherwise. See start-databases/verify-schema!.

Throw when the live Datalevin schema does not satisfy the RAD-derived expected
schema; returns true otherwise. See start-databases/verify-schema!.
sourceraw docstring

wrap-datalevin-deleteclj

source

wrap-datalevin-saveclj

source

wrap-envclj

Plain (fn [env] env') that adds Datalevin connections/databases to the env. This is the Pathom 3 integration point (compose into env-middleware); it also underlies the Pathom 2 pathom-plugin. See datalevin.pathom-plugin.

Plain `(fn [env] env')` that adds Datalevin connections/databases to the env.
This is the Pathom 3 integration point (compose into env-middleware); it also
underlies the Pathom 2 `pathom-plugin`. See datalevin.pathom-plugin.
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