You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since queries are executed client-side, it's possible but not idea to squeak by without user-defined database functions. Transactions are not, though, and for expressive transactions user-defined database functions are a hard requirement. The simplest way to do this is probably to support Lua or some similar scripting language in the transactor, and possibly in the query language as well.
Datomic requires functions to be installed on the transactor ahead of time, which is one option. Another would be to define a special function attribute db:fn, analogous to db:ident et al, which would allow an entity to act as a function:
-- Define the function
{db:ident string:palindrome db:fn "function palindrome(s) return s == string.reverse(s) end"}
-- Use the function in a query
find ?e where ?e person:name ?name, string:palindrome(?name)
There might need to be different types for query functions (used as predicates or to generate data) vs transaction functions (which can make arbitrary mutations to the database).
The text was updated successfully, but these errors were encountered:
Since queries are executed client-side, it's possible but not idea to squeak by without user-defined database functions. Transactions are not, though, and for expressive transactions user-defined database functions are a hard requirement. The simplest way to do this is probably to support Lua or some similar scripting language in the transactor, and possibly in the query language as well.
Datomic requires functions to be installed on the transactor ahead of time, which is one option. Another would be to define a special function attribute
db:fn
, analogous todb:ident
et al, which would allow an entity to act as a function:There might need to be different types for query functions (used as predicates or to generate data) vs transaction functions (which can make arbitrary mutations to the database).
The text was updated successfully, but these errors were encountered: