@farming-labs/orm

EdgeDB / Gel

Farming Labs ORM supports EdgeDB through the current Gel SQL client runtime.

That means the supported path is:

This is intentionally a runtime-first integration, not a Gel SDL or schema management replacement.

What this gives you

You still write the schema and storage layer once.

Then the runtime translates that layer into Gel SQL-backed relational queries with:

That makes it useful for frameworks, reusable platform modules, auth state, billing state, internal tools, and other storage layers that should not fork into one implementation per backend.

Create the runtime directly

edgedb-runtime.ts
import { createOrm } from "@farming-labs/orm";
import { createEdgeDbDriver } from "@farming-labs/orm-edgedb";
import { createClient } from "gel";
import { appSchema } from "./schema";

const client = createClient();

const orm = createOrm({
  schema: appSchema,
  driver: createEdgeDbDriver({
    client,
  }),
});

Use the runtime helper path

If a framework or shared package wants to accept the raw Gel client and normalize it later, use the runtime helpers:

import { createOrmFromRuntime } from "@farming-labs/orm-runtime";

const orm = await createOrmFromRuntime({
  schema: appSchema,
  client,
});

That keeps the package boundary generic instead of forcing an EdgeDB-only branch.

Setup helpers

EdgeDB support here is runtime-first.

That means:

So the common pattern is:

Joins, relations, and transactions

This runtime uses the PostgreSQL SQL dialect path underneath.

That means:

The main boundary is not query power. It is schema management:

What is supported well

Important limits

Why it matters

This keeps EdgeDB / Gel inside the same bigger ORM story: