<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk" -->

---
title: Why use ORMs if LLMs write code? | daily.dev
description: An ORM skeptic argues that with LLMs now capable of writing boilerplate code, the traditional justification for using ORMs (avoiding tedious SQL mapping code)...
canonical: https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Why use ORMs if LLMs write code? | daily.dev
og:description: An ORM skeptic argues that with LLMs now capable of writing boilerplate code, the traditional justification for using ORMs (avoiding tedious SQL mapping code)...
og:url: https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk
og:image: https://api.daily.dev/og/posts/SWrI5TplK.png
og:image:alt: Why use ORMs if LLMs write code?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why use ORMs if LLMs write code?

**[ploeh blog](https://daily.dev/sources/ploeh)** · 2 min read · 111 upvotes · 44 comments

## Summary

An ORM skeptic argues that with LLMs now capable of writing boilerplate code, the traditional justification for using ORMs (avoiding tedious SQL mapping code) largely disappears. The author contends that ORM query optimization already requires deep expertise and workarounds, undermining the promise of abstraction, and suggests it may be simpler to have an LLM write parametrized SQL directly rather than fight with an ORM's implicit API, while cautioning about SQL injection risks.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.ploeh.dk/2026/08/13/why-use-orms-if-llms-write-code>

## Community discussion

Top comments from developers on daily.dev.

**@froggobytes** · 18 upvotes

> first of all, the cost would be massive, relying on AI for every SQL query you make. Second, it will be harder to maintain the query provided by AI. This is just a bad idea because of the excess reliance on AI for something as basic as SQL queries (things that help you talk to your databases).

**@imjb87** · 17 upvotes

> The use of an ORM is far more than just "avoiding SQL"

**@pascal14** · 9 upvotes

> And while we’re at it, why not get rid of all those pesky libraries that introduce dependencies and let AI generate the entire MSIL or assembly code directly?
>
> Abstraction and layers are what make the software mantainable.
>
> Would you ask the AI to write 347 different SQL sentences to cover the needed flexibility of filters and ordering fields? Or would you create (or ask AI to create) a single method that builds the SQL dynamically? Which solution would be mantainable, and which one would be like shooting yourself in the foot?

**@eliasaliche** · 5 upvotes

> That's kind of a weird take.
> ORMs don't just add abstraction over db languages like SQL. They also do optimizations and bring a boatload of convenient tools. AI is the naïve-brute-force approach when deterministic tools are too expensive to develop, but ORMs already exist.

**@vasefanten** · 3 upvotes

> i don't see the point, there are so many alternative frameworks out there eliminating the need for an orm. some generate code, some provide fluent api's, some let you write sql and manages the rest for you.
>
> i have no problems with orms myself, but i can see why people want to avoid the complexity.

## Similar posts on daily.dev

- [The peril of laziness lost](https://daily.dev/posts/the-peril-of-laziness-lost-bmm7yrxcb) · Hacker News · 13 upvotes · 1 comments
- [Software Development in 2026](https://daily.dev/posts/software-development-in-2026-q2wl4qawy) · Beam Bloggers Webring · 4 upvotes · 0 comments
- [You Don't Need an ORM](https://daily.dev/posts/you-don-t-need-an-orm-ogsa8bhdq) · ElixirStatus · 89 upvotes · 18 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#backend](https://daily.dev/tags/backend), [#sql](https://daily.dev/tags/sql)

[View this post on daily.dev](https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Why use ORMs if LLMs write code?","url":"https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk"},"datePublished":"2026-08-13T06:57:26.278Z","dateModified":"2026-09-14T07:06:25.302Z","description":"An ORM skeptic argues that with LLMs now capable of writing boilerplate code, the traditional justification for using ORMs (avoiding tedious SQL mapping code)...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"ploeh blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ploeh blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/0645fe7a0b9f40ba9ef17f7a7b49e893","url":"https://daily.dev/sources/ploeh"},"commentCount":44,"discussionUrl":"https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":111},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":44}],"keywords":"llm,backend,sql","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ploeh blog","item":"https://daily.dev/sources/ploeh"},{"@type":"ListItem","position":3,"name":"Why use ORMs if LLMs write code?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/why-use-orms-if-llms-write-code--swri5tplk","comment":[{"@type":"Comment","text":"first of all, the cost would be massive, relying on AI for every SQL query you make. Second, it will be harder to maintain the query provided by AI. This is just a bad idea because of the excess reliance on AI for something as basic as SQL queries (things that help you talk to your databases).","datePublished":"2026-08-13T08:14:11.104Z","url":"https://daily.dev/posts/SWrI5TplK#c-GKLWxyJr9","author":{"@type":"Person","name":"FroggoBytes","url":"https://daily.dev/froggobytes","image":"https://lh3.googleusercontent.com/a/ACg8ocIhg6NN-TLfaXu8cQTdOSSfKRyxQz9X2NJZBbdTiYjb8BPjg12j=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":18}},{"@type":"Comment","text":"The use of an ORM is far more than just “avoiding SQL”","datePublished":"2026-08-13T08:15:27.612Z","url":"https://daily.dev/posts/SWrI5TplK#c-1LquOtlex","author":{"@type":"Person","name":"John Bell","url":"https://daily.dev/imjb87","image":"https://avatars.githubusercontent.com/u/46000619?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":17}},{"@type":"Comment","text":"And while we’re at it, why not get rid of all those pesky libraries that introduce dependencies and let AI generate the entire MSIL or assembly code directly?\nAbstraction and layers are what make the software mantainable.\nWould you ask the AI to write 347 different SQL sentences to cover the needed flexibility of filters and ordering fields? Or would you create (or ask AI to create) a single method that builds the SQL dynamically? Which solution would be mantainable, and which one would be like shooting yourself in the foot?","datePublished":"2026-08-13T09:45:43.069Z","url":"https://daily.dev/posts/SWrI5TplK#c-U9vAAfyep","author":{"@type":"Person","name":"Pascal","url":"https://daily.dev/pascal14","image":"https://lh3.googleusercontent.com/a/ACg8ocLjmH2kfHuAvcPrefwTqrsgQz3x78MHWm17FvKEXKD5QKNBJHtj=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9}},{"@type":"Comment","text":"That’s kind of a weird take.\nORMs don’t just add abstraction over db languages like SQL. They also do optimizations and bring a boatload of convenient tools. AI is the naïve-brute-force approach when deterministic tools are too expensive to develop, but ORMs already exist.","datePublished":"2026-08-13T10:18:15.884Z","url":"https://daily.dev/posts/SWrI5TplK#c-fwcjj2OxS","author":{"@type":"Person","name":"Elias Aliche","url":"https://daily.dev/eliasaliche","image":"https://media.daily.dev/image/upload/s--GVlzrUxp--/f_auto/v1732125180/avatars/avatar_DrmjqCjWat0UCbJgBJHBZ"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"i don’t see the point, there are so many alternative frameworks out there eliminating the need for an orm. some generate code, some provide fluent api’s, some let you write sql and manages the rest for you.\ni have no problems with orms myself, but i can see why people want to avoid the complexity.","datePublished":"2026-08-13T09:58:10.998Z","url":"https://daily.dev/posts/SWrI5TplK#c-GbrD2bzxS","author":{"@type":"Person","name":"Jon Martin Solaas","url":"https://daily.dev/vasefanten","image":"https://lh3.googleusercontent.com/a/AAcHTtdHxjxGjsMmadn7MDZFagbwVN8HGgilPitNdxWSkqlu9nD6=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}}]}
```

