Persisted Queries or Simple Stored Procedures #3486
amaster507
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
maybe this is already possible with Functions: https://www.edgedb.com/docs/datamodel/functions It is not clear if a Function can call a SELECT, UPDATE, DELETE, or FOR statements. So maybe all that might be needed here is a example of Function being uses to make a simple stored procedure. But then I wonder if you can call it at top level directly. I have not tested this theory but it may be possible. The definition of a function looks like it can run any edgeQL query? https://www.edgedb.com/docs/reference/sdl/functions#ref-eql-sdl-functions |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I did see: #2687 But believe this is a little simpler than that.
What I would like to see if possible before the whole custom extension pack is extended out, is a way to persist a query and call it with the possibility of passing in variables.
If I have a rather lengthy query (reminding myself that mutations are queries also in edgeQL) that I run somewhat regularly for a process. Instead of storing the whole query on another codebase, I would like to be able to persist it to the edgeDB layer. Then I could call it very simply like you would a SQL stored procedure. I know it is trivial, but it would also relieve a little bit of data moving across layers if we didn't have to send the whole query every time when it is the same only the variables changed.
Maybe some ideas could be drawn from:
This could be added at both the GraphQL endpoint per spec, and also directly in edgeQL itself.
I could also see stored procedures making later development provide an even better UX.
Beta Was this translation helpful? Give feedback.
All reactions