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
We would like a way to support common functions and user defined one. It might be useful to be able to use now() to refer to the current timestamp for instance or a way to get a contextual record.
Requirements
Support an identifier followed by parentheses like function("something") or now().
Goals
Being able to write get Event where start_time > now() that would convert to Database's NOW() function when querying.
Being able to write get Event where id = current_id() that would return a given value from the assign's map.
API proposal
Implement a function invoke/3 in EctoDefinition with the following signature
Where assigns would be usual user provided assigns containing various properties (like role or permission for instance). Invoke could return a raw value or a queryable, like a fragment.
The text was updated successfully, but these errors were encountered:
We would like a way to support common functions and user defined one. It might be useful to be able to use
now()
to refer to the current timestamp for instance or a way to get a contextual record.Requirements
Support an identifier followed by parentheses like
function("something")
ornow()
.Goals
Being able to write
get Event where start_time > now()
that would convert to Database'sNOW()
function when querying.Being able to write
get Event where id = current_id()
that would return a given value from the assign's map.API proposal
Implement a function
invoke/3
in EctoDefinition with the following signatureWhere
assigns
would be usual user provided assigns containing various properties (like role or permission for instance). Invoke could return a raw value or a queryable, like a fragment.The text was updated successfully, but these errors were encountered: