3 ms·
Yeah if you’re doing lots of CRUD that approach quickly becomes an exercise in writing your own (bad, buggy) ORM.
by macNchz 7y ago
Yeah if you’re doing lots of CRUD that approach quickly becomes an exercise in writing your own (bad, buggy) ORM.
- megous 7y agoNot at all. The only cumbersome thing about SQL, that is common enough and unpleasant to always spell out by hand are basic INSERT and UPDATE commands. I use a set of 3-4 functions that I reuse pretty much in all my programs for this. It's no ORM, as it doesn't map classes to tables/data in the database. It's just a shortcut to generate and execute INSERT/UPDATE commands on arbitrary tables with arbitrary columns. Also it has zero bugs, because you can hardly create bugs in something so simple.
- throwawaycorn 7y ago> you can hardly create bugs in something so simple. You may have underestimated how bad things are in some of the unicorns.. 1. Creating your own query builder before understanding the purpose of bind param: https://medium.com/tokopedia-engineering/dynamic-sql-query-builder-in-golang-2c71e2c21ff8 https://medium.com/tokopedia-engineering/dynamic-sql-query-b... 2. ??? 3. Profit from SQL injection: https://www.youtube.com/watch?v=PKkNjOweWTE https://www.youtube.com/watch?v=PKkNjOweWTE