Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions versioned_docs/version-3.x/migrate-prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ZenStack v3 doesn't depend on Prisma at runtime. Its CLI has a peer dependency o
- Remove `prisma` and `@prisma/client` from your project dependencies.
- Install ZenStack packages

<PackageInstall dependencies={['@zenstackhq/runtime@next']} devDependencies={['@zenstackhq/cli@next']} />
<PackageInstall dependencies={['@zenstackhq/orm@next']} devDependencies={['@zenstackhq/cli@next']} />

- Install a database driver

Expand Down Expand Up @@ -87,7 +87,7 @@ Replace `new PrismaClient()` with `new ZenStackClient(schema, ...)` where `schem
<TabItem value="postgres" label={`PostgreSQL`}>

```ts title='db.ts'
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { schema } from './zenstack/schema';
import { PostgresDialect } from 'kysely';
import { Pool } from 'pg';
Expand All @@ -105,7 +105,7 @@ export const db = new ZenStackClient(schema, {
<TabItem value="sqlite" label={`SQLite`}>

```ts title='db.ts'
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { SqliteDialect } from 'kysely';
import SQLite from 'better-sqlite3';
import { schema } from './zenstack/schema';
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/orm/access-control/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ After defining access control policies in ZModel, it's time to enjoy their benef
Similar to the schema side, access control's runtime aspect is encapsulated in the `@zenstackhq/plugin-policy` package too, as a Runtime Plugin (more about this topic [later](../plugins/index.md)). You should install it on the raw ORM client to get a new client instance with access control enforcement.

```ts
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { PolicyPlugin } from '@zenstackhq/plugin-policy';

// create an unprotected, "raw" ORM client
Expand Down
6 changes: 3 additions & 3 deletions versioned_docs/version-3.x/orm/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The samples below only show creating a client using SQLite (via [better-sqlite3]
<PackageInstall dependencies={["better-sqlite3"]} devDependencies={['@types/better-sqlite3']} />

```ts title='db.ts'
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { SqliteDialect } from 'kysely';
import SQLite from 'better-sqlite3';
import { schema } from './zenstack/schema';
Expand All @@ -43,7 +43,7 @@ export const db = new ZenStackClient(schema, {
<PackageInstall dependencies={["pg"]} devDependencies={['@types/pg']} />

```ts title='db.ts'
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { schema } from './zenstack/schema';
import { PostgresDialect } from 'kysely';
import { Pool } from 'pg';
Expand All @@ -63,7 +63,7 @@ export const db = new ZenStackClient(schema, {
The created `db` object has the full ORM API inferred from the type of the `schema` parameter. When necessary, you can also explicitly get the inferred client type like:

```ts
import type { ClientContract } from '@zenstackhq/runtime';
import type { ClientContract } from '@zenstackhq/orm';
import type { SchemaType } from '@/zenstack/schema';

export type DbClient = ClientContract<SchemaType>;
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/orm/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: ORM Errors

# Errors

The ORM uses the following error classes from `@zenstackhq/runtime` to represent different types of failures:
The ORM uses the following error classes from `@zenstackhq/orm` to represent different types of failures:

## `InputValidationError`

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/orm/inferred-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Most of the time, you don't need to explicitly type the input and output of the

- `ModelResult`

The `ModelResult` generic type from `@zenstackhq/runtime` allows you to infer the exact model type given field selection and relation inclusion information.
The `ModelResult` generic type from `@zenstackhq/orm` allows you to infer the exact model type given field selection and relation inclusion information.

## Samples

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/orm/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can also always configure a project manually with the following steps:

1. Install dependencies

<PackageInstall devDependencies={['@zenstackhq/cli@next']} dependencies={['@zenstackhq/runtime@next']} />
<PackageInstall devDependencies={['@zenstackhq/cli@next']} dependencies={['@zenstackhq/orm@next']} />

2. Create a `zenstack/schema.zmodel` file

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_label: API

# API Reference

## `@zenstackhq/runtime`
## `@zenstackhq/orm`

### `class ZenStackClient`

Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-3.x/reference/plugins/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The following functions can be used in policy conditions:
The plugin exports a runtime plugin `PolicyPlugin` that can be installed on the ORM client to enable access control enforcement.

```ts
import { ZenStackClient } from '@zenstackhq/runtime';
import { ZenStackClient } from '@zenstackhq/orm';
import { PolicyPlugin } from '@zenstackhq/plugin-policy';

const db = new ZenStackClient(...);
Expand Down
4 changes: 2 additions & 2 deletions versioned_docs/version-3.x/reference/zmodel/attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ _Params_:
attribute @@meta(_ name: String, _ value: Any)
```

Adds arbitrary metadata to a model. The metadata can be accessed by custom plugins for code generation, or at runtime from the `modelMeta` object exported from `@zenstackhq/runtime/model-meta`. The `value` parameter can be an arbitrary literal expression, including object literals.
Adds arbitrary metadata to a model. The metadata can be accessed by custom plugins for code generation, or at runtime from the `modelMeta` object exported from `@zenstackhq/orm/model-meta`. The `value` parameter can be an arbitrary literal expression, including object literals.

```zmodel
model User {
Expand Down Expand Up @@ -482,7 +482,7 @@ attribute @json()
attribute @meta(_ name: String, _ value: Any)
```

Adds arbitrary metadata to a field. The metadata can be accessed by custom plugins for code generation, or at runtime from the `modelMeta` object exported from `@zenstackhq/runtime/model-meta`. The `value` parameter can be an arbitrary literal expression, including object literals.
Adds arbitrary metadata to a field. The metadata can be accessed by custom plugins for code generation, or at runtime from the `modelMeta` object exported from `@zenstackhq/orm/model-meta`. The `value` parameter can be an arbitrary literal expression, including object literals.

```zmodel
model User {
Expand Down