@zenstackhq/orm 3.5.0-beta.4 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @zenstackhq/orm
2
+
3
+ The core ZenStack ORM engine, built on top of [Kysely](https://kysely.dev/). Provides a type-safe database client (`ZenStackClient`) with a high-level, [Prisma](https://prisma.io/)-compatible CRUD API and direct access to the underlying Kysely query builder for advanced queries.
4
+
5
+ ## Key Features
6
+
7
+ - **Type-safe CRUD operations** generated from your ZModel schema
8
+ - **Plugin system** for query interception and entity mutation hooks
9
+ - **Multi-dialect support** — SQLite (better-sqlite3), PostgreSQL (pg), and MySQL (mysql2)
10
+ - **Computed fields** evaluated at the database level
11
+ - **Custom procedures** for encapsulating complex queries and mutations
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @zenstackhq/orm
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```typescript
22
+ import { ZenStackClient } from '@zenstackhq/orm';
23
+ import schema from './schema';
24
+
25
+ const client = new ZenStackClient(schema, {
26
+ /* dialect config */
27
+ });
28
+
29
+ const user = await client.user.findFirst({ where: { email: 'alice@example.com' } });
30
+ ```
31
+
32
+ ## Learn More
33
+
34
+ - [ZenStack Documentation](https://zenstack.dev/docs)
package/dist/index.cjs CHANGED
@@ -9191,7 +9191,7 @@ var ClientImpl = class _ClientImpl {
9191
9191
  return newClient;
9192
9192
  }
9193
9193
  $setAuth(auth) {
9194
- if (auth !== void 0 && typeof auth !== "object") {
9194
+ if (auth !== void 0 && (typeof auth !== "object" || auth === null || Array.isArray(auth))) {
9195
9195
  throw new Error("Invalid auth object");
9196
9196
  }
9197
9197
  const newClient = new _ClientImpl(this.schema, this.$options, this);