Code-first object layer over PostgreSQL

Think in objects.
Never write SQL.

Weave is an object abstraction over PostgreSQL. Design entities, query by nesting, and enforce access as code. The database speaks SQL underneath — you only ever speak objects.

$npm install @mauroandre/weave-sdk
orders.ts
const weave = createClient({ url, key, entities });

const orders = await weave.order.findMany(
  {
    status: "paid",                                       // { eq: "paid" }, shorthand
    items: { some: { product: { name: { ilike: "%pro%" } } } },
  },
  {
    orderBy: { customer: { name: "asc" } },
    expand:  { customer: true, items: { product: true } },
  },
);

orders[0].customer.name;          // string  — typed, you expanded it
orders[0].items[0].product.price; // number  — nested, revived, inferred

A database that thinks like your code

Postgres gives you the durability. Weave gives you the developer experience.

No SQL, ever

Tables, joins and migrations never surface. Every interface — GUI, code, API — speaks the same object vocabulary.

Think in nested objects

Compose with owned objects and reference other entities. Read a graph by asking to expand it — no join syntax.

One query language

The same WhereInput powers a GUI click, an SDK call, and a stored access rule. Learn it once.

Typed end-to-end

Returns self-type by your expand. No hand-written result types, no codegen drift — the shape follows the query.

Code or GUI, mixed

Design entities in the dashboard or in code. The server is the source of truth; weave gen mirrors it back as readable .ts.

Access control as code

Scopes shape access per entity — which verbs, which rows, which fields — stored by stable id, enforced on the server.

Two threads, woven

The relational thread and the object thread, crossing where they meet. That interlace — the teal — is the whole idea: the rigor of Postgres with the shape of the objects you actually work with.

Entities as code

One file, one entity

Declare entities with the same builders the server uses — columns, owned objects, references. weave push diffs and applies them behind a risk gate; weave gen mirrors the server back into typed .ts.

weave/entities/order.ts
export default defineEntity("order", {
  ref: text().notNull().unique(),
  status: text().notNull().default("open"),
  customer: reference(customer),
  items: owned(array({
    product: reference(product),
    qty: int4().notNull(),
  })),
});

Two pieces, that's it

Run the server, install the client.

1. The server

Engine, dashboard and API in one container. Point it at your Postgres and go.

ghcr.io
docker run -p 3000:3000 \
  -e DATABASE_URL=postgres://… \
  ghcr.io/mauro-andre/weave

2. The SDK

Install the typed client in your app. Objects in, objects out, HTTP invisible.

$npm install @mauroandre/weave-sdk
Read the quickstart →

Start weaving

From a Postgres URL to a typed object client in minutes.