3 ms·
The query languages that aren't SQL keep popping up and they're honestly nicer to read/write in application code in many contexts but none have the ecosystem/ma
by leetrout 11mo ago
The query languages that aren't SQL keep popping up and they're honestly nicer to read/write in application code in many contexts but none have the ecosystem/maturity or "every BI tool speaks it" advantage. Until there's a single non SQL language that runs efficiently everywhere from my laptop to the datacenter and every tool between SQL wins.
SQL forever? Maybe but please let me stop writing it as strings in my actual application code. Sqlc is a hope for me. It is almost like treating your DB as an RPC.
- Apreche 11mo agoThere is already a way to completely avoid writing SQL strings in your application code, and it’s not even an ORM. In your SQL database create lots of views and functions. Don’t be shy. There is no limit to how many you can make. Every single time your application needs to do a parameterized query, have it call an SQL function instead. This method probably increases how much SQL you have to write overall. But it allows you to completely separate the SQL from whatever other programming language you are using. All the SQL exists in one area with whatever framework you have for handling schema migrations. Your application code now interacts with the database via an API of functions you have designed and never actually builds a query.