2 ms·
There 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 an
by Apreche 10mo ago
There 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.