Parse a string as a Datalog query.
Parse a string as a Datalog query.
val query = Query(""" [:find ?e :where [?e :db/doc]] """)
Implemented as a macro. The string is parsed at compile time, so any parsing errors will result in compliation failure. The parsing checks that the string is valid EDN, and a further round of minimal validate is performed to ensure that the EDN has the expected structure to be a Datalog query.
The macro also determines the input and output arity of the query. The declared return type of the macro is AbstractQuery, but the concrete return type is of the form
TypedQueryN[AnyRef, ..., TupleN[Any, ...]]
When the resulting query is executed, it returns a Iterable[TupleN[Any, ...]]
a Datalog query as a string
an arity-typed query as a data structure
Parse a string a collection of Datalog rules.
Parse a string a collection of Datalog rules.
Macro-based helper to create Rule alias to be used in Queries.
val rules = Datomic.Query.rules(""" [[[doc ?e ?d] [?e :db/doc ?d]]] """)
Implemented as a macro. The string is parse at compile time, so any parsing errors will result in complation failure.
Datalog rules as a string
Datalog rules as a data structure
Provides methods for parsing Datalog queries and rules.