---
title: "When to choose an ORM for your Database"
description: "ORMs, query builders and raw SQL each fit different situations, and many projects do best mixing them."
url: "https://swe.quest/articles/when-to-choose-an-orm-for-your-database-81a466157e5ffa81"
canonical: "https://turso.tech/blog/when-to-choose-an-orm-for-your-database-11a05b42"
source: "Turso"
published: "2023-12-06"
difficulty: "easy"
kind: "Opinion"
reading_minutes: 6
tags: ["databases","sql","typescript"]
---

# When to choose an ORM for your Database

A post on [Turso](https://swe.quest/sources/turso.md), published 2023-12-06, 6 min read, Opinion. Original: [https://turso.tech/blog/when-to-choose-an-orm-for-your-database-11a05b42](https://turso.tech/blog/when-to-choose-an-orm-for-your-database-11a05b42)

## Summary

ORMs, query builders and raw SQL each fit different situations, and many projects do best mixing them. ORMs offer generated types, migrations, database portability and framework conventions (Rails, Laravel, NestJS), while raw SQL avoids performance overhead, missing adapters, large serverless bundles and opaque generated queries. Query builders sit in between, giving more control than an ORM while still requiring SQL knowledge. Examples show Prisma's libSQL adapter, Drizzle with @libsql/client, and plain @libsql/client queries against Turso.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- relational databases ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

Prisma, Drizzle, libSQL, Turso, ActiveRecord

## Related posts

- [ORMs vs. Query Builders for your Typescript application](https://swe.quest/articles/orms-vs-query-builders-for-your-typescript-application-9783c98c487b60f6.md): Neon · 2023-05-16 · Medium · 9 min read · TypeScript, PostgreSQL, Schema migrations, Developer tools, SQL
  Drizzle, Kysely, Prisma and Zapatos are compared as type-safe Postgres libraries for TypeScript across schema definition, query syntax, raw SQL support, migrations, edge-runtime support and community size.
- [Build a Database App with Drizzle ORM and Deno](https://swe.quest/articles/build-a-database-app-with-drizzle-orm-and-deno-692f9df52f193839.md): Deno · 2024-11-13 · Medium · 7 min read · TypeScript, PostgreSQL, JavaScript, Schema migrations
  Drizzle ORM can be used from Deno via npm compatibility to get type-safe CRUD access to PostgreSQL.
- [We're building Postgres in Rust. Using the LLVM of databases](https://swe.quest/articles/we-re-building-postgres-in-rust-using-the-llvm-of-databases-e44d34208278a99e.md): Turso · 2026-07-16 · Easy · 11 min read · PostgreSQL, SQLite, Rust, Query engines, Open source
  Turso, a Rust rewrite of SQLite, is adding a Postgres frontend by parsing Postgres SQL into a common AST and compiling it to Turso's VDBE bytecode, turning the engine into an "LLVM of databases" with pluggable frontends.
- [pg\_graphql v1.0](https://swe.quest/articles/pg-graphql-v1-0-5a4770d60b17d945.md): Supabase · 2022-12-16 · Medium · 5 min read · GraphQL, PostgreSQL, Rust, Performance engineering
  pg\_graphql, a PostgreSQL extension that compiles GraphQL requests into a single SQL query, reaches 1.0 with a SemVer backwards-compatibility guarantee.
- [Turso Adds Ruby on Rails Support](https://swe.quest/articles/turso-adds-ruby-on-rails-support-80c171904d4e2326.md): Turso · 2024-12-18 · Medium · 3 min read · Ruby, SQLite, Databases
  Turso has released a technical preview of libsql\_activerecord, an ActiveRecord adapter that connects Rails applications to Turso/libSQL databases.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
