Skip to main content
Sequelize is a modern TypeScript and Node.js ORM that supports multiple SQL databases. With solid transaction support, associations, eager and lazy loading, read replication, and a rich query builder, Sequelize lets you work with your database using JavaScript or TypeScript instead of raw SQL.

Get Started

Install Sequelize and connect to your database in minutes

Dialects

PostgreSQL, MySQL, MariaDB, SQLite, MSSQL, Oracle, Snowflake, DB2, and IBM i

Models

Define models with attributes, data types, and validations

Querying

Create, read, update, and delete records with a fluent API

Associations

BelongsTo, HasOne, HasMany, and BelongsToMany relationships

Transactions

ACID-compliant transactions with savepoints and CLS support

CLI & Migrations

Generate and run database migrations and seeders

API Reference

Full API documentation for the Sequelize class and all exports

Quick example

import { Sequelize, DataTypes, Model } from '@sequelize/core';
import { PostgresDialect } from '@sequelize/postgres';

const sequelize = new Sequelize({
  dialect: PostgresDialect,
  database: 'mydb',
  user: 'myuser',
  password: 'mypassword',
  host: 'localhost',
});

class User extends Model {}

User.init(
  {
    firstName: DataTypes.STRING,
    lastName: DataTypes.STRING,
  },
  { sequelize, modelName: 'User' },
);

await sequelize.sync();
const user = await User.create({ firstName: 'Jane', lastName: 'Doe' });
console.log(user.firstName); // 'Jane'

Key features

Multi-dialect

Connect to PostgreSQL, MySQL, MariaDB, SQLite, MS SQL Server, Oracle DB, Snowflake, DB2, and IBM i from the same API

TypeScript-first

Full TypeScript support with class decorators, type inference, and accurate typings for all public APIs

Rich associations

Model relationships with BelongsTo, HasOne, HasMany, and BelongsToMany — with eager and lazy loading

Transactions & hooks

ACID transactions, savepoints, CLS-based automatic transaction passing, and lifecycle hooks

Build docs developers (and LLMs) love