Documentation

Everything you need to know about building with Stabilize ORM

Getting Started
Learn the basics and set up your first Stabilize project
Models & Relationships
Define your data models and establish relationships
Query Builder
Build complex queries with our fluent API
CLI Reference
Master the command-line tools for migrations and more
Quick Start
Get up and running in minutes

1. Install Stabilize

bun add stabilize-orm

2. Configure your database

import { DBType, type DBConfig } from "stabilize-orm";

const dbConfig: DBConfig = {
  type: DBType.Postgres,
  connectionString: process.env.NEON_DATABASE_URL,
};

3. Define your first model

import { defineModel, DataTypes } from "stabilize-orm";

const User = defineModel({
  tableName: "users",
  columns: {
    id: { type: DataTypes.Integer, required: true },
    email: { type: DataTypes.String, length: 100 },
  },
});