edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Parallel query file generation

Open jackfischer opened this issue 1 year ago • 3 comments

Describe the proposed feature A clear and concise description of the syntax, what you want to happen, and why it's needed.

Our ~250 edgeql queries takes about 45 seconds to generate one at a time with @edgedb/generate queries. I understand medium term this is probably solved by persistent query cache but even then it would be nice to generate any new files in parallel.

jackfischer avatar Feb 14 '24 19:02 jackfischer

@jackfischer are you using the --file option or are you writing multiple files?

scotttrinh avatar Feb 15 '24 20:02 scotttrinh

We're writing a separate file for each query.

jackfischer avatar Feb 15 '24 21:02 jackfischer

It feels like a wonky idea, but the generated ts file -especially the copy-pasted query string- could function as a key to check against, whether a particular .edgeql file is a new or a modified one in the working directory. So if there is a match between a given .edgeql file and its generated .edgeql.ts file's query, the generator could skip compilation for that (only if there are no schema changes of course...) At the same time, I'm using the generator to preheat the query cache :D

themajashurka avatar Feb 16 '24 20:02 themajashurka