> Every UQL docs page, as Markdown: https://uql-orm.dev/llms.txt
> The same docs over MCP: https://uql-orm.dev/mcp
> Before writing UQL code, read the skill: https://uql-orm.dev/.well-known/agent-skills/uql-orm/SKILL.md

# JSON-native TypeScript ORM for Bun and Node

> A TypeScript ORM whose queries are plain JSON values, typed down to every field, with no codegen and one API across every SQL database, MongoDB and runtime.

Source: https://uql-orm.dev/

## Every key is type-checked

A query is a plain object: no builder to chain, no operators to import. The compiler checks every key at any depth, and the operators (`$in`, `$gte`, `$or`, …) are MongoDB’s. The red lines in the editor above are real `tsc` errors against the published types: a misspelled field, the same typo inside a populated relation, and an operator the column’s type does not allow.

Entities are plain classes with standard decorators, so there is no schema file and no client to regenerate. Checking reaches into [JSON](https://uql-orm.dev/querying/json.md) dot-paths too. See [Entities](https://uql-orm.dev/entities/basic.md).

## The same query, from browser to backend

A query is data, so the browser can send it over HTTP, typed the same as on the server:

Browser:

```ts
import { HttpQuerier } from 'uql-orm/browser';

const http = new HttpQuerier('/api');

const { data } = await http.findMany(User, {
  $select: { id: true, email: true },
  $where: { email: { $endsWith: '@uql-orm.dev' } },
});
```

entities.ts:

```ts
import { v7 as uuidv7 } from 'uuid';
import { Entity, Id, Field } from 'uql-orm';

@Entity()
export class User {
  @Id({ type: 'uuid', onInsert: uuidv7 })
  id!: string;

  @Field({ type: String, unique: true, nullable: false })
  email!: string;
}
```

uql.config.ts:

```ts
import { PgQuerierPool } from 'uql-orm/postgres';

export const pool = new PgQuerierPool({
  connectionString: process.env.DATABASE_URL,
});
```

Server:

```ts
import { createFetchHandler } from 'uql-orm/http';

export const handler = createFetchHandler({ pool, include: [User] });
```

The handler runs each write in a transaction, takes authorization hooks, and mounts on Hono, Elysia, Next.js, Express, Bun or Workers. See the [HTTP transport](https://uql-orm.dev/http.md) and the [browser client](https://uql-orm.dev/browser.md).

## The rest, briefly

- Runs on PostgreSQL, PGlite, CockroachDB, MySQL, MariaDB, SQL Server, SQLite, Turso, libSQL, Neon, Cloudflare D1, Bun SQL and MongoDB, on Node 22.18+, Bun, [Workers](https://uql-orm.dev/cloudflare-d1.md), [Lambda and Vercel](https://uql-orm.dev/serverless.md) and [the browser](https://uql-orm.dev/browser.md). ESM only.
- Zero runtime dependencies; `uql-orm/postgres` is about 41 kB gzipped.
- No N+1 queries: [relations](https://uql-orm.dev/querying/relations.md) load in one statement.
- [Migrations](https://uql-orm.dev/migrations.md) with drift checks, [vector search](https://uql-orm.dev/ai-semantic-search.md), [raw SQL](https://uql-orm.dev/querying/raw-sql.md), [multi-tenancy](https://uql-orm.dev/multi-tenancy.md), [soft delete](https://uql-orm.dev/entities/soft-delete.md), [triggers](https://uql-orm.dev/entities/triggers.md) and [streaming](https://uql-orm.dev/querying/streaming.md) in the same package.
- The least overhead of any ORM we measured on a PostgreSQL round trip, on Bun and Node ([benchmark](https://uql-orm.dev/benchmark.md)).

Compare it [feature by feature](https://uql-orm.dev/comparison.md) and [on type safety](https://uql-orm.dev/type-safety.md).
