u/False-Marketing-5663

▲ 6 r/webdev

I've been using Prisma (both in Python and TypeScript), for a while. When the core team of Prisma decided to rewrite its core to another language, and thus abandon the project, I could not find any other ORM that satisfied my needs. That is why me and few friends have been working on Nautilus.

Nautilus is a schema-first ORM toolkit built around a Rust query engine, with generated clients for Python, TypeScript, and Rust.

You define your database schema in a .nautilus file, and Nautilus generates a typed client you can use directly in your application, similar to what Prisma used to do.

Its key features are:

  • Schema-first design – your database structure is the single source of truth
  • Rust-powered engine – fast query execution via JSON-RPC
  • Client generation – Python, TypeScript, and Rust
  • Multi-database support – PostgreSQL, MySQL, SQLite
  • Migrations & schema diffing built-in
  • CLI tooling – generatedb pushmigrate, etc.
  • LSP + VSCode extension for the schema language
  • Studio – A modern and powerful local database editor written in Next

This is a dummy example of a Nautilus schema

generator client {
  provider = "nautilus-client-py"  // or "nautilus-client-rs", "nautilus-client-js"
  output   = "db" // optional
}

type Address {
  street  String
  city    String
  zip     String
  country String
}

model User {
  id        Uuid            (uuid())
  email     String    
  username  VarChar(30)
  name      String
  balance   Decimal(10, 2) (balance > 0)
  bio       String?
  tags      String[]
  address   Address?
  createdAt DateTime       (now()) ("created_at")
  updatedAt DateTime        ("updated_at")

  @@index([email], type: Hash)
  @@index([createdAt], type: Brin, map: "idx_users_created")
  @@map("users")
}

nautilus generate

import asyncio
from db import Nautilus # from output, if omitted defaults to nautilus

async def main():
    async with Nautilus() as client:
        user = await client.user.create({
            "email": "alice@example.com",
            "username": "alice",
            "name": "Alice",
        })

        found = await client.user.find_unique(
            where={"email": "alice@example.com"}
        )

asyncio.run(main())

nautilus generate

Compared to Prisma:

  • Shares a similar workflow and philosophy
  • But Nautilus is designed to be language-agnostic, not JS-first
  • Nautilus benchmarks on the python client beats prisma-python

The repo can be found here (engine + studio + docs): https://github.com/nautilus-env/nautilus

u/False-Marketing-5663 — 20 days ago