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

terminal
❯bun add stabilize-orm

2. Configure your database

config/database.ts
import { DBType, type DBConfig } from "stabilize-orm";
const dbConfig: DBConfig = {
type: DBType.SQLite,
connectionString: "./data/app.db",
};

3. Define your first model

models/User.ts
import { defineModel, DataTypes } from "stabilize-orm";
const User = defineModel({
tableName: "users",
columns: {
id: { type: DataTypes.STRING, required: true, unique: true },
email: { type: DataTypes.STRING, length: 255 },
},
});