Liking cljdoc? Tell your friends :D

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

Utility functions for Datalevin adapter - query helpers.

Utility functions for Datalevin adapter - query helpers.
raw docstring

(fulltext-search db query)
(fulltext-search db query {:keys [domains top limit offset]})

Full-text search via Datalevin's built-in search engine. Returns [[eid score] ...] in descending-score (most-relevant-first) order, deduped by eid (best score kept). Raw scored matches — no Pathom, no ident projection. This is the primitive the generated :<ns>/search resolver is built on; use it directly for custom ranking, filtering, or batch work.

query is a string, a boolean expression vector like [:and "x" [:not "y"]], or {:phrase "..."} (phrase search requires the domain to be indexed with :index-position? true).

Options:

  • :domains — vector of search-domain strings to search within.
  • :top — cap on engine results (Datalevin default 10).
  • :limit / :offset — pagination within the result window.

NOTE: ordering is obtained via {:display :refs+scores} plus an explicit sort — Datalog's set semantics do NOT preserve the engine's rank order.

Full-text search via Datalevin's built-in search engine. Returns
`[[eid score] ...]` in descending-score (most-relevant-first) order, deduped
by eid (best score kept). Raw scored matches — no Pathom, no ident
projection. This is the primitive the generated `:<ns>/search` resolver is
built on; use it directly for custom ranking, filtering, or batch work.

`query` is a string, a boolean expression vector like
`[:and "x" [:not "y"]]`, or `{:phrase "..."}` (phrase search requires
the domain to be indexed with `:index-position? true`).

Options:
- `:domains` — vector of search-domain strings to search within.
- `:top`     — cap on engine results (Datalevin default 10).
- `:limit` / `:offset` — pagination within the result window.

NOTE: ordering is obtained via `{:display :refs+scores}` plus an explicit
sort — Datalog's set semantics do NOT preserve the engine's rank order.
sourceraw docstring

pullclj

(pull db pattern eid)

Pull entity data from the database. Convenience wrapper around datalevin.core/pull.

Pull entity data from the database.
Convenience wrapper around datalevin.core/pull.
sourceraw docstring

pull-manyclj

(pull-many db pattern eids)

Pull multiple entities from the database. Convenience wrapper around datalevin.core/pull-many.

Pull multiple entities from the database.
Convenience wrapper around datalevin.core/pull-many.
sourceraw docstring

qclj

(q query & args)

Execute a Datalog query against the database. Convenience wrapper around datalevin.core/q.

Execute a Datalog query against the database.
Convenience wrapper around datalevin.core/q.
sourceraw docstring

seed-database!clj

(seed-database! conn data)

Seed a database with initial data.

Arguments:

  • conn: Datalevin connection
  • data: vector of entity maps to transact

Returns the transaction result.

Seed a database with initial data.

Arguments:
- conn: Datalevin connection
- data: vector of entity maps to transact

Returns the transaction result.
sourceraw docstring

vec-attr-domainclj

(vec-attr-domain qualified-key)

Convert a qualified keyword to a Datalevin vector domain string. Matches datalevin.vector/attr-domain: replaces '/' with '_' (each :db.type/vec attribute is automatically its own vector search domain).

Convert a qualified keyword to a Datalevin vector domain string.
Matches datalevin.vector/attr-domain: replaces '/' with '_' (each
:db.type/vec attribute is automatically its own vector search domain).
sourceraw docstring

(vec-search db query-vector)
(vec-search db query-vector {:keys [attribute domains top]})

Nearest-neighbor search over :db.type/vec attributes. Returns [[eid distance] ...] in ascending-distance (nearest-first) order, deduped by eid (best distance kept). Raw scored neighbors — no Pathom, no ident projection. This is the primitive the generated :<ns>/similar resolver is built on; use it directly for custom ranking, filtering, or batch work.

Options:

  • :attribute — qualified keyword of a specific :vec attribute to search.
  • :domains — vector of vector-domain strings (see vec-attr-domain); used when :attribute is not given.
  • :top — cap on engine results (Datalevin default 10).

NOTE: ordering is obtained via {:display :refs+dists} plus an explicit sort — Datalog's set semantics do NOT preserve the engine's rank order.

Nearest-neighbor search over `:db.type/vec` attributes. Returns
`[[eid distance] ...]` in ascending-distance (nearest-first) order, deduped
by eid (best distance kept). Raw scored neighbors — no Pathom, no ident
projection. This is the primitive the generated `:<ns>/similar` resolver is
built on; use it directly for custom ranking, filtering, or batch work.

Options:
- `:attribute` — qualified keyword of a specific `:vec` attribute to search.
- `:domains`   — vector of vector-domain strings (see `vec-attr-domain`);
                 used when `:attribute` is not given.
- `:top`       — cap on engine results (Datalevin default 10).

NOTE: ordering is obtained via `{:display :refs+dists}` plus an explicit
sort — Datalog's set semantics do NOT preserve the engine's rank order.
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