ORMs and database toolkits

ORMs and query builders connect your app's code to a SQL database.

Use for: Database queries, application data models and schema migrations.

Active Record (Rails) Open source
Active Record (Rails) homepage

The ORM at the heart of Ruby on Rails: convention-over-configuration models, associations, validations, callbacks and a Ruby migration DSL that keeps schema.rb in sync.

Bun (Go ORM) Open source
Bun (Go ORM) homepage

SQL-first Go ORM from Uptrace, built on database/sql, whose query builder reads like SQL and supports PostgreSQL, MySQL/MariaDB, SQL Server, SQLite and Oracle, with migrations and fixtures.

Dapper Open source
Dapper homepage

Micro-ORM for .NET, created at Stack Overflow, that adds Query and Execute extension methods to ADO.NET connections to run your SQL and map results to objects with very little overhead.

Diesel Open source
Diesel homepage

Rust ORM and query builder that checks queries against your schema at compile time, with a CLI for migrations and schema generation; supports PostgreSQL, MySQL, MariaDB and SQLite.

Doctrine ORM Open source
Doctrine ORM homepage

PHP's main data mapper ORM, built on the Doctrine DBAL, with a unit of work, DQL query language inspired by Hibernate, and the default persistence layer in Symfony.

Drizzle ORM Open source
Drizzle ORM homepage

Lightweight TypeScript ORM with SQL-shaped query builders, schemas declared in TypeScript, zero dependencies and a CLI (Drizzle Kit) for migrations and a free data browser.

Ecto Open source
Ecto homepage

Elixir's standard database toolkit: repositories, schemas, composable queries and changesets for validation, with ecto_sql adding migrations and adapters for PostgreSQL, MySQL, SQL Server and SQLite.

Eloquent ORM Open source
Eloquent ORM homepage

Laravel's built-in Active Record ORM: one model class per table, expressive relationships, scopes, events and soft deletes, with Laravel's schema migrations and five first-party databases.

Ent Open source
Ent homepage

Go entity framework that generates a fully typed query API from schemas written as Go code, with graph-style traversal of relations and Atlas-powered versioned migrations.

Entity Framework Core Open source
Entity Framework Core homepage

Microsoft's open-source ORM for .NET: LINQ queries, change tracking, migrations and providers for SQL Server, PostgreSQL, SQLite, MySQL, Oracle, Cosmos DB and more, released yearly alongside .NET.

GORM Open source
GORM homepage

The most widely used Go ORM: struct-based models, associations, hooks, preloading, transactions and AutoMigrate, with official drivers for MySQL, PostgreSQL, SQLite, SQL Server, TiDB and Oracle.

Hibernate ORM Open source
Hibernate ORM homepage

Java's most established ORM and the reference-style Jakarta Persistence (JPA) implementation, with HQL, two-level caching and support for more than a dozen databases; Apache 2.0 licensed since version 7.

jOOQ Freemium
jOOQ homepage

SQL-first Java library that generates classes from your database schema and lets you write type-safe SQL in Java, Kotlin or Scala; free for open-source databases, paid editions for commercial ones.

Knex.js Open source
Knex.js homepage

Veteran multi-dialect SQL query builder for Node.js with transactions, connection pooling, streaming and a built-in migration and seed runner; active again with releases through 2026.

Kysely Open source
Kysely homepage

Type-safe TypeScript SQL query builder that infers result types from your database schema, compiles one-to-one to SQL and runs in Node, Deno, Bun, Workers and browsers.

MikroORM Open source
MikroORM homepage

TypeScript ORM built on Data Mapper, Unit of Work and Identity Map patterns, with change tracking, SQL and MongoDB drivers, and a dependency-free core since version 7.

Peewee Open source
Peewee homepage

Small, single-module Python ORM with no required dependencies, an expressive query builder, asyncio support since 4.0 and diff-based migrations, maintained by one author since 2010.

Prisma Freemium
Prisma ORM homepage

Schema-first TypeScript ORM that generates a typed client and migrations from one schema file; free and open source, with paid hosted Postgres and hosting alongside.

SeaORM Open source
SeaORM homepage

Async Rust ORM built on SeaQuery and SQLx, with familiar ActiveRecord-like entities, relation loading without N+1 queries, a CLI to generate entities, and a free admin panel add-on.

Sequelize Open source
Sequelize homepage

Long-running Node.js ORM with models, associations, eager loading and soft deletes across many SQL databases; version 6 is stable while version 7 has stayed in alpha for years.

SQLAlchemy Open source
SQLAlchemy homepage

Python's standard SQL toolkit and ORM: a Core expression language plus a unit-of-work ORM, with Alembic for migrations and dialects for most SQL databases; version 2.1 shipped in September 2026.

sqlc Open source
sqlc homepage

Compiler that turns hand-written SQL queries and your schema into type-safe Go code, with plugins for Kotlin, Python, TypeScript and community languages; catches SQL errors at build time.

SQLModel Open source
SQLModel homepage

Thin Python ORM from the FastAPI author that combines SQLAlchemy and Pydantic, so one annotated class is both the database table and the API data model.

SQLx Open source
SQLx homepage

Async, pure-Rust SQL toolkit whose macros check hand-written SQL against a real database at compile time; supports PostgreSQL, MySQL, MariaDB and SQLite, with a CLI for migrations.

Tortoise ORM Open source
Tortoise ORM homepage

Async-native Python ORM with a Django-style model and query API, built-in migrations since 1.0, and drivers for SQLite, PostgreSQL, MySQL, SQL Server and Oracle.

TypeORM Open source
TypeORM homepage

Decorator-based TypeScript ORM supporting both Active Record and Data Mapper, with the widest database list in the JavaScript world; reached 1.0 in May 2026 under new maintainers.

Tool Pricing LanguageApproachDatabasesMigrations
Active Record (Rails) guides.rubyonrails.org · OSS
Open source Ruby Full ORM (Active Record) SQLite, MySQL/MariaDB, PostgreSQL; more via gems Yes, Ruby DSL migrations with schema.rb
Bun (Go ORM) bun.uptrace.dev · OSS
Open source Go SQL-first ORM / query builder PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, Oracle Yes, Go and SQL migration files (written by hand)
Dapper github.com · OSS
Open source C# / .NET Micro-ORM (SQL you write, object mapping) Any ADO.NET provider (SQL Server, Postgres, MySQL...) No; use a separate tool
Diesel diesel.rs · OSS
Open source Rust ORM and query builder (compile-time checked) PostgreSQL, MySQL, MariaDB, SQLite Yes, diesel_cli with up/down SQL files
Doctrine ORM doctrine-project.org · OSS
Open source PHP 8.1+ Full ORM (Data Mapper, Unit of Work) MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle, Db2 Yes, via the separate Doctrine Migrations package
Drizzle ORM orm.drizzle.team · OSS
Open source TypeScript / JavaScript Query builder plus relational ORM API Postgres, MySQL, SQLite, SingleStore, MSSQL, CockroachDB Yes, Drizzle Kit generate/migrate/push; no down migrations
Ecto hexdocs.pm · OSS
Open source Elixir Data mapper with query DSL and changesets PostgreSQL, MySQL, SQL Server, SQLite, ClickHouse Yes, versioned migrations via ecto_sql
Eloquent ORM laravel.com · OSS
Open source PHP Full ORM (Active Record) MariaDB, MySQL, Postgres, SQLite, SQL Server, MongoDB Yes, Laravel migrations (written with the Schema builder)
Ent entgo.io · OSS
Open source Go Full ORM with code generation (schema as code) MySQL, MariaDB, TiDB, Postgres, CockroachDB, SQLite Auto migration, or versioned files generated with Atlas
Entity Framework Core learn.microsoft.com · OSS
Open source C# / .NET Full ORM (LINQ, change tracking) SQL Server, SQLite, Postgres, MySQL, Oracle, Cosmos DB Yes, EF Migrations generated from the model
GORM gorm.io · OSS
Open source Go Full ORM (optional code generation with GORM Gen) MySQL, PostgreSQL, SQLite, SQL Server, TiDB, Oracle, GaussDB AutoMigrate (additive only); no versioned files
Hibernate ORM hibernate.org · OSS
Open source Java / Kotlin (JVM) Full ORM (Jakarta Persistence) Postgres, MySQL, Oracle, SQL Server, Db2, HANA, 7+ more Schema export only; use Flyway or Liquibase
jOOQ jooq.org · OSS
Freemium Java / Kotlin / Scala SQL-first query builder with code generation Open-source DBs free; Oracle, SQL Server, Db2 paid No; pair with Flyway or Liquibase
Knex.js knexjs.org · OSS
Open source JavaScript (TypeScript typings) Query builder Postgres, MySQL, MariaDB, CockroachDB, MSSQL, SQLite, Oracle Yes, built-in runner with up/down files; not generated
Kysely kysely.dev · OSS
Open source TypeScript / JavaScript Query builder (no entities or relations layer) Postgres, MySQL, SQL Server, SQLite, PGlite, community Built-in Migrator, hand-written up/down files
MikroORM mikro-orm.io · OSS
Open source TypeScript / JavaScript Full ORM (Data Mapper, Unit of Work) Postgres, MySQL, MariaDB, SQLite, MSSQL, Oracle, MongoDB Yes, generated from entity metadata; up and down
Peewee github.com · OSS
Open source Python Full ORM with query builder SQLite, MySQL, MariaDB, PostgreSQL Yes, pwmigrate with diff-based generation
Prisma ORM prisma.io · OSS
Freemium TypeScript / JavaScript Full ORM, schema-first with generated client Postgres, MySQL, SQLite, SQL Server, CockroachDB, MongoDB Yes, Prisma Migrate generates SQL from the schema
SeaORM sea-ql.org · OSS
Open source Rust Full ORM (async, dynamic) PostgreSQL, MySQL, MariaDB, SQLite Yes, migration crate and sea-orm-cli
Sequelize sequelize.org · OSS
Open source JavaScript / TypeScript Full ORM (Active Record style models) Postgres, MySQL, MariaDB, SQLite, MSSQL, Oracle, Db2 Yes, via sequelize-cli; written by hand, not generated
SQLAlchemy sqlalchemy.org · OSS
Open source Python Full ORM plus Core SQL expression builder Postgres, MySQL, SQLite, Oracle, MSSQL, many external Via Alembic (autogenerate from models)
sqlc sqlc.dev · OSS
Open source Go (plugins: Kotlin, Python, TypeScript, others) SQL-first code generation PostgreSQL, MySQL (stable), SQLite (beta) No; reads goose, golang-migrate, Atlas files
SQLModel sqlmodel.tiangolo.com · OSS
Open source Python Full ORM (thin layer over SQLAlchemy) Any SQLAlchemy database: PostgreSQL, MySQL, SQLite and more Via Alembic (SQLAlchemy's tool); none built in
SQLx github.com · OSS
Open source Rust SQL-first toolkit with compile-time checked queries PostgreSQL, MySQL, MariaDB, SQLite Yes, sqlx-cli and embedded migrations
Tortoise ORM tortoise.github.io · OSS
Open source Python (asyncio) Full ORM, Django-style SQLite, PostgreSQL, MySQL, SQL Server, Oracle Yes, built-in makemigrations/migrate since 1.0
TypeORM typeorm.io · OSS
Open source TypeScript / JavaScript Full ORM (Active Record or Data Mapper) Postgres, MySQL, SQLite, MSSQL, Oracle, Spanner, MongoDB Yes, generated from entity changes via the CLI

Freemium means a free plan plus paid plans. Open a tool for its plans, prices and sources.

§1

How to choose an ORM

Terms: ORM, Postgres, Managed database

  • Decide how close to SQL you want to be: query builders (Drizzle, Kysely) look like SQL; full ORMs (Prisma, TypeORM, SQLAlchemy’s ORM) hide more of it.
  • Check it supports your database and your runtime, especially on edge and serverless platforms where some ORMs need a special driver.
  • Look at migrations: generated from your schema, written by hand, or both.
  • Pick what your framework’s tutorials and your AI assistant use; examples matter more than small feature differences.

Questions

Prisma or Drizzle?

Prisma has its own schema file, generated client and admin tools; Drizzle defines the schema in TypeScript and writes queries that read like SQL. Both are free, support Postgres, MySQL and SQLite, and work with most hosts.

§2

Pricing changes

  • SQLAlchemy 2.1 released

    SQLAlchemy · source ↗

  • Prisma 8 enters release candidate

    Prisma ORM · source ↗

  • SeaORM 2.0 stable

    SeaORM · source ↗

  • TypeORM reaches 1.0 after ten years

    TypeORM · source ↗

  • SQLx 0.9 released; repository moves to transact-rs

    SQLx · source ↗

All pricing changes →