Skip to main content
Kit provides a powerful database layer built on top of SeaORM, offering a Laravel-inspired experience for working with databases in Rust.

Key Features

  • Multiple Database Support - SQLite, PostgreSQL, and MySQL
  • Type-Safe Queries - Leverage Rust’s type system for compile-time query validation
  • Active Record Pattern - Model and ModelMut traits for intuitive CRUD operations
  • DB Facade - Simple static access to database connections
  • Automatic Entity Generation - Generate Rust entities from your database schema
  • Migration System - Laravel-style migrations for schema management

Architecture

Kit’s database layer consists of several components:

Quick Example

Here’s a complete example showing how to work with a database model:

Getting Started

Configuration

Set up your database connection and configure connection pooling

Models

Learn about the Model and ModelMut traits for CRUD operations

Queries

Build complex queries with SeaORM’s query builder

Migrations

Manage your database schema with migrations

Supported Databases

Prerequisites

Before working with databases in Kit, ensure you have:
  1. A database server running (or use SQLite for local development)
  2. The DATABASE_URL environment variable set in your .env file
  3. Migrations created and run (see Migrations)