Hacker News new | ask | show | jobs
by MrTawti 1428 days ago
Congratulation on the 2.0 release. EdgeDB looks awesome. However, I will not advocate using it for any of my clients unless there's a clear path to derisking its adoption. Like all new software products/services there's a significant risk of it becoming abandonware. I'd obviously want EdgeDB to succeed but how can one de-risk adopting it? Would it be possible to somehow "transpile" both queries and modeling scripts to readable SQL? That way, worste case scenario one may fall back on Postgresql without loosing most of previous work. Let me be clear. I really like EdgeDB and obviously want the best for and you guys but I do not think I'm alone in thinking that we need a clear, easy and verifiable way to fallback to Posgresql if/when needed.
2 comments

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.
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>

I'm working on a npm package [1] that "transpile" from a syntax inspired by edgedb into raw sql. The generated sql and be used with original database, without additional running process.

I've implemented select columns, join tables and where statements. Still having more to work on (e.g. order by, group by, aggregate function, and more important, the readme)

[1] https://github.com/beenotung/better-sql