Put more emphasis on parameterized queries in the documentation #1565
CodesInChaos
started this conversation in
Ideas
Replies: 1 comment 8 replies
-
I cannot agree more. EdgeDB does extract constants and parametrises queries automatically, but in this isn't just the performance issue: using parametrized queries is simply more convenient to the user. @CodesInChaos Would you be interested in submitting a PR? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As a developer I'd like to use parameterized queries as much as possible. EdgeDB's powerful support for json should allow this for pretty complex queries.
Unfortunately the documentation treats parameterized queries and variables as an afterthought. It'd be nice if you added some examples, especially for non trivial mutation scenarios,
For example the frontpage showcase for mutations is a query that hardcodes the data to be inserted:
You could add a variant of this query where the query is fixed and the data to be inserted is passed as a json document like:
The tutorial has a similar example where a movie contains nested INSERTs for actors while inserting a movie. That one would also make a nice example for parameterized queries.
Beta Was this translation helpful? Give feedback.
All reactions