Skip to content

Roadmap signal: effect-orm as the ORM of the CAFE stack #52

Open

Description

@artile

What this is

This issue groups a set of signal issues from the MyRemotely team. Each one says where we want effect-orm to go. They are not demands, and they are not PRs yet. We open them to show direction and ask for your view. We can send PRs for the items you accept. #48 and PRs #49–#51 (SQLite / D1) are our first steps.

Our context

MyRemotely is a multi-tenant SaaS for rental property managers: locks, tours and resident messages. We build on the CAFE stack: Cloudflare (Workers, D1, Durable Objects), Alchemy, Foldkit, Effect.

We plan to move our database from MariaDB to Cloudflare: D1 for shared and per-org data, and Durable Object SQLite for stateful entities. We want to do the move with effect-orm.

Today's schema, from schema.prisma, and our production code:

Fact Count
Tables / enums 101 / 30
Relations / onDelete: Cascade 130 / 106
Indexes / composite uniques 215 / 39
Json / DateTime columns 67 / 274
cuid() ids / @updatedAt 77 / 48
findUnique + findFirst call sites 652
include: / _count 61 / 104
upsert / createMany 70 / 20
FOR UPDATE raw sites 29
Unique-violation (P2002) handlers 27

Why effect-orm and not Drizzle

Drizzle 1.0 has Effect drivers for MySQL, D1 and DO. But in Drizzle, Effect is a wrapper: a query is yieldable, all errors share one tag, and rows are not decoded by a Schema. effect-orm already has what Drizzle cannot add on top: row Schemas derived from each query, a tenant-scope proof, and transactions as a requirement in R. We want to make it the best Drizzle alternative in the CAFE stack.

The issues come from three sources:

  1. Cloudflare needs. What the MariaDB → D1 / DO move requires.
  2. Effect-native. Ideas from effect-qb and from Effect core (SqlModel, SqlResolver, BeginTransaction).
  3. Drizzle / Prisma parity. The features we use every day.

Issues

Cloudflare: the MariaDB → D1 / DO move

Effect-native

Drizzle / Prisma parity

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions