edgedb / edgedb-js

The official TypeScript/JS client library and query builder for EdgeDB
https://edgedb.com
Apache License 2.0
511 stars 65 forks source link

Parallel query file generation #865

Open jackfischer opened 7 months ago

jackfischer commented 7 months ago

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.

scotttrinh commented 7 months ago

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

jackfischer commented 7 months ago

We're writing a separate file for each query.

themajashurka commented 7 months ago

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