Hacker News new | ask | show | jobs
by shortrounddev2 237 days ago
I've always found it odd that most databases don't expose a kind of query bytecode API that SQL can be converted to. It would allow more kinds of languages, different SQL dialects, compile-time optimizations, and perhaps ORM could be compiled directly into your target database spec. Would reduce the amount of string operations by client code, at least
1 comments

For translation between dialects, you could use projects such as SQLGlot. The advantage of SQL is the standardization over many decades (yes, I know that it's still a mess with the different dialects).
SQLGlot is amazing. In many ways it helps erase the differences and bridge between dialects. It is so useful for moving complex queries between platforms.
Agreed, and it's an amazingly well-maintained GitHub repo: https://github.com/tobymao/sqlglot

Big kudos to Toby and the team.