Python: Just Write SQL
ORMs do much more than &quot;write SQL&quot;.  This is about 40% of the value they add.<p>As this argument comes up over, and over, and over, and over again, writers of the &quot;bah ORM&quot; club continuously thinking, well I&#x27;m not sure, that ORMs are just going to go &quot;poof&quot; one day?  I wrote some years back the &quot;SQL is Just As Easy as an ORM Challenge&quot; which demonstrates maybe a few little things that ORMs do for you besides &quot;write SQL&quot;, like persisting and loading data between classes and  tables that are joined in various very common ways to represent associations between classes:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;zzzeek&#x2F;5f58d007698c4a0c372edd95ab8e0267" rel="nofollow noreferrer">https:&#x2F;&#x2F;gist.github.com&#x2F;zzzeek&#x2F;5f58d007698c4a0c372edd95ab8e0...</a><p>this is why whenever someone writes one of these &quot;just write SQL&quot; comments, or wow here a whole blog post!  wow.  I just shake my head.  Because this is not at all what the ORM is really getting you.  Plenty of ORMs let you write raw SQL or something very close to it.  The SQL is not really the point.   It&#x27;s about the rows and objects, moving the data from the objects to the INSERT statement, moving the data from the rows you SELECTed back to the objects.   Not to mention abstraction over all the other messy things the database drivers do like dealing with datatypes and stuff like that.<p>It looks like in this blog post, they actually implemented their own nano-ORM that stores one row and queries one table.  Well great, now scale that approach up and see how much fun it is to write the same boilerplate XYZRepository &#x2F; XYZPostgresqlRepository code with the same INSERT &#x2F; SELECT statement over, and over again.   I&#x27;d sure want to automate all that tedium.    I&#x27;d want a one-to-many collection too maybe.<p>You can use SQLAlchemy (which I wrote) and write all the SQL 100% yourself as literal strings, and still use the ORM, and still be using an enormous amount of automation to deal with the database drivers and moving data between your objects and rows.   But why would anyone really want to, writing SQL for CRUD is really repetitive and tedious.   Computer can do that for you.