LITEORM v0.1.3 • SCHEMA-FIRST POSTGRESQL

Type-Safe PostgreSQL ORM & Desktop Studio for Rust

Define your schema once. Generate strictly typed, compile-time safe Rust queries. Ship with transactional migrations and a native cross-platform Desktop Studio.

Get Started View on GitHub
cargo install lite-orm-cli lite-orm-studio COPY
ZERO JS • STRICT TYPES
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

struct User {
  id        Int32    @id @default(autoincrement())
  email     String   @unique
  name      String
  active    Boolean  @default(true)
  createdAt DateTime @default(now()) @map("created_at")
  posts     Post[]
}

struct Post {
  id        Int32    @id @default(autoincrement())
  title     String
  content   String?
  userId    Int32    @map("user_id")
  user      User     @relation(fields: [userId], references: [id])
}
mod liteorm;
use lite_orm::{Database, Model};
use liteorm::{User, Post};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db = Database::connect_env().await?;

    // Type-safe SELECT with parameterized WHERE
    let active_users = db
        .all(User::select()
            .where_(User::ACTIVE.equals(true))
            .limit(20))
        .await?;

    // Safe deletion guarded against unconstrained drops
    db.delete(Post::delete().where_(Post::USER_ID.equals(12))).await?;

    Ok(())
}
-- Transactional, idempotent PostgreSQL migration
BEGIN;

CREATE TABLE "User" (
  "id" SERIAL PRIMARY KEY,
  "email" TEXT NOT NULL UNIQUE,
  "name" TEXT NOT NULL,
  "active" BOOLEAN NOT NULL DEFAULT true,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE "Post" (
  "id" SERIAL PRIMARY KEY,
  "title" TEXT NOT NULL,
  "content" TEXT,
  "user_id" INTEGER NOT NULL REFERENCES "User"("id")
);

COMMIT;

Engineered for Rust Reliability

Prisma's developer ergonomics fused with Rust's uncompromising safety and performance.

SAFETY

Guarded Mutations

Destructive mutations like UPDATE and DELETE strictly require filter predicates or an explicit override, preventing accidental database wipes.

TRANSACTIONS

Atomic Migrations

Every generated migration and its audit log execute inside a single PostgreSQL transaction with schema-scoped session advisory locks for zero race conditions.

DESKTOP

Native Studio

100% native desktop management app built with Dioxus Desktop. No web server, zero JS bloat, and instantaneous live relation inspections.

INTROSPECTION

Bi-Directional Sync

Run liteorm db pull to reverse-engineer existing PostgreSQL tables, native ENUMs, and array types into schemas, or liteorm db push to apply additive changes instantly.

SQL

Safe Parameterization

All query values use PostgreSQL bound parameters and never string concatenation. Full support for platform TLS via rustls.

DESIGN

Monochrome Precision

Distraction-free high-contrast duo-tone interface strictly built with #FFFEFA and #000000. Pure, focused, and crisp.

LiteORM Desktop Studio

Inspect, filter, and create database records natively on macOS, Linux, and Windows with real-time row counts and responsive data tables.

LiteORM Studio (Desktop) — postgresql://localhost:5432/my_app
MODELS (2)
User 3 rows
Post 42 rows
FILTER + Add Record
3 records loaded
ID EMAIL NAME ACTIVE RELATIONS
1 alice@liteorm.dev Alice Vance true 3 Post
2 bob@liteorm.dev Bob Smith true 1 Post
3 charlie@liteorm.dev Charlie Brown false 0 Post

Get Started in Seconds

Follow the standard schema-first workflow from zero to production.

1

Install CLI & Desktop Studio

Install the liteorm command-line tools and native Desktop Studio application globally via Cargo.

cargo install lite-orm-cli lite-orm-studio
2

Initialize project and schema

Generate a starter liteorm.schema and .env file, or introspect an existing database.

liteorm init # Scaffolds starter schema
liteorm db pull # Or reverse-engineer existing PostgreSQL database
3

Sync and Migrate with PostgreSQL

Directly push additive changes during prototyping, or generate versioned transactional migrations.

liteorm db push # Direct additive sync
liteorm migrate dev # Versioned transactional migration
4

Generate Rust models and launch Studio

Compile schema definitions into strictly typed Rust structs and launch the cross-platform desktop UI.

liteorm generate # Generates src/liteorm.rs
liteorm studio # Launches native Desktop Studio