Skip to content
VibORM
Esc
navigateopen⌘Jpreview
On this page

Introduction

Prisma-inspired TypeScript ORM without code generation or WASM query-engine deployment issues

VibORM is a Prisma-inspired TypeScript ORM with zero code generation: types are inferred from your schema the moment you save, and there is no WASM query engine, so it runs anywhere TypeScript runs — including edge runtimes like Cloudflare Workers.

What It Looks Like

import { s } from "viborm";
import { createClient } from "viborm/pg";

// Define schema - types are inferred from this
const user = s.model({
  id: s.string().id().ulid(),
  email: s.string().unique(),
  name: s.string().nullable(),
  posts: s.oneToMany(() => post),
});

const post = s.model({
  id: s.string().id().ulid(),
  title: s.string(),
  published: s.boolean().default(false),
  authorId: s.string(),
  author: s.manyToOne(() => user).fields("authorId").references("id"),
});

// Create client
const client = createClient({
  schema: { user, post },
  databaseUrl: process.env.DATABASE_URL,
});

// Prisma-inspired queries, fully typed
const users = await client.user.findMany({
  where: { email: { contains: "@company.com" } },
  include: { posts: { where: { published: true } } },
});

If you know Prisma, this should feel familiar: findMany, findFirst, create, update, delete, nested include, and where filters follow the same patterns. The public contract is intentionally narrower than Prisma today — see Compatibility for supported operations and known differences.

Features

  • PostgreSQL, MySQL, and SQLite supported through adapters
  • Implicit many-to-many — define relations without manual join tables
  • Rich filteringcontains, startsWith, in, not, and more
  • Deep relation filteringwhere: { posts: { some: { published: true } } }
  • Single query execution — relations loaded in one roundtrip, no N+1
  • Nested writes — create or connect related records in one operation where the compatibility contract lists support
  • Standard Schema integration — extend any scalar with Zod, Valibot, or any Standard Schema validator via .schema()

Beyond schema definition, every operation schema (where, create, update) is Standard Schema V1 compliant and exportable to JSON Schema — reuse them in API routes, OpenAPI generation, or AI tool calling via getSchemas. See Standard Schema.

Some features are still in progress: transactions (partial) and migration edge cases. If you need stability today, Prisma is battle-tested.

Next Steps

Why VibORM?

VibORM started as an experiment in how far vibe coding can go, driven by two Prisma friction points: the prisma generate step and WASM query-engine deployment issues. Read the full story.

Was this page helpful?