ORM covers object-relational mapping libraries that let applications work with databases through language-native objects and methods instead of writing raw SQL by hand. This includes Prisma and Drizzle for JavaScript and TypeScript, SQLAlchemy for Python, Sequelize as an older JavaScript option, and Hibernate for Java, along with lighter query builders that sit between a full ORM and raw SQL.
The core trade-off across ORMs is abstraction versus control. Full ORMs like Hibernate and SQLAlchemy generate SQL automatically from object relationships and offer features like lazy loading and automatic migrations, which speeds up development but can produce inefficient queries if the underlying SQL generation isn't well understood. Query builders like Knex or Drizzle stay closer to SQL syntax while still providing type safety and a programmatic interface, giving more predictable query output at the cost of some convenience.
Type safety has become a bigger differentiator in newer ORMs. Prisma and Drizzle both generate or infer TypeScript types from the database schema, catching mismatches between code and schema at compile time rather than at runtime, which matters more as a codebase and its database schema grow and diverge over time without careful coordination.
Migration handling also varies: some ORMs auto-generate migrations from model changes, which is convenient but occasionally produces migrations that need manual review before running against production data.
Points to weigh when comparing ORMs: