4 ms·
I really like what PRQL[0] is doing. Fixes a lot of the unfortunate SQL syntax. My impossible dream is that after years of language stability, Postgres could ma
by fbdab103 4y ago
I really like what PRQL[0] is doing. Fixes a lot of the unfortunate SQL syntax. My impossible dream is that after years of language stability, Postgres could make it a first party query language.
[0] https://prql-lang.org/ https://prql-lang.org/
- LeonenTheDK 4y agoWow, this looks like it fixes a lot of the minor gripes I have with SQL, thanks for mentioning it. It feels way less cludgy and "modernized" compared to SQL.
- iudqnolq 4y agoThat reminds me of the Ecto DSL.
- TylerE 4y agoMaybe as a baby step we could just get legal trailing commas
- candiddevmike 4y agoOr force the big RDBMS to use the same syntax like SQL was intended to be, so I don't have to reach for an ORM or maintain different flavors of the same query. As an aside, if someone knows a tool that reliably converts PostgreSQL queries to something like SQLite, please share!
- alserio 4y agohaven't really tried for that transform but have a look at https://www.jooq.org/translate/ https://www.jooq.org/translate/
- TylerE 4y agoNot sure how such a tool could possibly exist, given all the functionality of Postgres that SQLite simply lacks.
- steve_gh 4y agoYou could ask ChatGPT to do this sort of conversion
- snthpy 4y agosqlglot might be what you are looking for. https://github.com/tobymao/sqlglot https://github.com/tobymao/sqlglot
- deleted 4y ago[deleted]
- jiggawatts 4y agoThe syntax looks very similar to Microsoft's Kusto Query Language (KQL): https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ https://learn.microsoft.com/en-us/azure/data-explorer/kusto/... It's interesting to see that everyone's attempt at fixing SQL seems to converge on surprisingly similar solutions...
- tehlike 4y agoMicrosoft did linq first which is probably the basis for the rest.
- fbdab103 4y agoFrom first principles, it seems reasonable to expect transformations to go in a linear order. From there you look for ways to minimize special cases (eg why is `where` different from `having`?). Then you can just layer on some quality of life things which would appear to a designer after five minutes of real-world use (dear god, please let me have trailing commas). I would expect there to be a lot of convergent evolution as how to go from a pile of data to narrowing on what you want.