Skip to content

Commit 38efdf7

Browse files
authored
doc: update orm package name (#501)
* doc: v3 query as a service * fix doc errors * addressing PR comments * add server adapter sample * update submodules * docs: update orm package name
1 parent 685bab3 commit 38efdf7

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

versioned_docs/version-3.x/migrate-prisma.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ZenStack v3 doesn't depend on Prisma at runtime. Its CLI has a peer dependency o
3232
- Remove `prisma` and `@prisma/client` from your project dependencies.
3333
- Install ZenStack packages
3434

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

3737
- Install a database driver
3838

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

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

107107
```ts title='db.ts'
108-
import { ZenStackClient } from '@zenstackhq/runtime';
108+
import { ZenStackClient } from '@zenstackhq/orm';
109109
import { SqliteDialect } from 'kysely';
110110
import SQLite from 'better-sqlite3';
111111
import { schema } from './zenstack/schema';

versioned_docs/version-3.x/orm/access-control/query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ After defining access control policies in ZModel, it's time to enjoy their benef
1313
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.
1414

1515
```ts
16-
import { ZenStackClient } from '@zenstackhq/runtime';
16+
import { ZenStackClient } from '@zenstackhq/orm';
1717
import { PolicyPlugin } from '@zenstackhq/plugin-policy';
1818

1919
// create an unprotected, "raw" ORM client

versioned_docs/version-3.x/orm/client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The samples below only show creating a client using SQLite (via [better-sqlite3]
2525
<PackageInstall dependencies={["better-sqlite3"]} devDependencies={['@types/better-sqlite3']} />
2626

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

4545
```ts title='db.ts'
46-
import { ZenStackClient } from '@zenstackhq/runtime';
46+
import { ZenStackClient } from '@zenstackhq/orm';
4747
import { schema } from './zenstack/schema';
4848
import { PostgresDialect } from 'kysely';
4949
import { Pool } from 'pg';
@@ -63,7 +63,7 @@ export const db = new ZenStackClient(schema, {
6363
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:
6464

6565
```ts
66-
import type { ClientContract } from '@zenstackhq/runtime';
66+
import type { ClientContract } from '@zenstackhq/orm';
6767
import type { SchemaType } from '@/zenstack/schema';
6868

6969
export type DbClient = ClientContract<SchemaType>;

versioned_docs/version-3.x/orm/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: ORM Errors
55

66
# Errors
77

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

1010
## `InputValidationError`
1111

versioned_docs/version-3.x/orm/inferred-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Most of the time, you don't need to explicitly type the input and output of the
1919

2020
- `ModelResult`
2121

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

2424
## Samples
2525

versioned_docs/version-3.x/orm/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can also always configure a project manually with the following steps:
4646

4747
1. Install dependencies
4848

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

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

versioned_docs/version-3.x/reference/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: API
66

77
# API Reference
88

9-
## `@zenstackhq/runtime`
9+
## `@zenstackhq/orm`
1010

1111
### `class ZenStackClient`
1212

versioned_docs/version-3.x/reference/plugins/policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The following functions can be used in policy conditions:
146146
The plugin exports a runtime plugin `PolicyPlugin` that can be installed on the ORM client to enable access control enforcement.
147147
148148
```ts
149-
import { ZenStackClient } from '@zenstackhq/runtime';
149+
import { ZenStackClient } from '@zenstackhq/orm';
150150
import { PolicyPlugin } from '@zenstackhq/plugin-policy';
151151
152152
const db = new ZenStackClient(...);

versioned_docs/version-3.x/reference/zmodel/attribute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ _Params_:
365365
attribute @@meta(_ name: String, _ value: Any)
366366
```
367367

368-
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.
368+
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.
369369

370370
```zmodel
371371
model User {
@@ -482,7 +482,7 @@ attribute @json()
482482
attribute @meta(_ name: String, _ value: Any)
483483
```
484484

485-
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.
485+
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.
486486

487487
```zmodel
488488
model User {

0 commit comments

Comments
 (0)