Hacker News new | ask | show | jobs
by RedCrowbar 1429 days ago
Demangling the schema into readable SQL schema is quite trivial already, as it's a fairly normal looking schema, except we use schema object ids in place of names (to simplify renaming). Turning EdgeQL into "readable" SQL is probably also possible, depending on your definition of "readable" and the complexity of a query, though the current codegen does not prioritize SQL readability at all.
2 comments

That's great regarding the schema! The biggest risk mitigation factor in my estimation would be preserving the schema and the data. Re-writing queries would be annoying but doable if the schema is relatively sane.

edit: ps I love the direction y'all are heading. EdgeQL feels more like relational-algebra notation which I always felt fit better with modern programming languages.

Thanks!
How can one test this. Say I create a model and a slue of EdgeQL queries. How does one get the equivalent SQL (like a EdgeQL command to spit out the equivalent SQL). If this is not possible yet, could we at least have some examples on the EdgeDB website so as to have an idea?
You can run the server in foreground [1] with `env EDGEDB_DEBUG_EDGEQL_COMPILE_SQL_TEXT=1` and observe emitted SQL.

[1] edgedb instance start --auto-restart --foreground -I <your instance>