Class: QueryBuilder

QueryBuilder()

new QueryBuilder()

A builder for datomic queries. This is meant to help build datomic queries in a more fluent manner. Without this, you would need to specify transit.Keyword and transit.Symbol values in your query, which is verbose and cumbersome.
Deprecated:
  • Use EDN template strings instead.
Source:

Methods

build() → {*}

Build the query.
Source:
Returns:
A value that can be sent via Connection.q.
Type
*

find(args)

Add a :find expression to the query. If there are already find elements added, these are added to the end.
Parameters:
Name Type Description
args Elements to find. Can either be strings (to find attributes) or composite query elements (pull, count, etc).
Source:
Returns:
This builder.

in(args)

Add an :in expression to the query.
Parameters:
Name Type Description
args The input sources. Can be strings, arrays of strings, or an array of a string and '...'.
Source:
Returns:
This builder.

keys(args) → {QueryBuilder}

Add a :keys expression to the query.
Parameters:
Name Type Description
args Symbol strings to add to the :keys clause.
Source:
Returns:
This instance.
Type
QueryBuilder

strs(args) → {QueryBuilder}

Add a :strs expression to the query.
Parameters:
Name Type Description
args Symbol strings to add to the :strs clause.
Source:
Returns:
This instance.
Type
QueryBuilder

syms(args) → {QueryBuilder}

Add a :syms expression to the query.
Parameters:
Name Type Description
args Symbol strings to add to the :syms clause.
Source:
Returns:
This instance.
Type
QueryBuilder

where(args) → {QueryBuilder}

Adds :where clauses to the query. Each argument may be one of the following:
  • [e, attr]
  • [e, attr, (symbol|value)]
  • [e, attr, (symbol|value), t]
  • [e, attr, (symbol|value), t, added]
  • [predicate-expression]
  • TODO there should be more.
Parameters:
Name Type Description
args Where clauses to add.
Source:
Returns:
This instance.
Type
QueryBuilder

with(args) → {QueryBuilder}

Add a :with expression to the query.
Parameters:
Name Type Description
args Symbol strings that should be added to the :with clause.
Source:
Returns:
This instance.
Type
QueryBuilder