zenstack-querying
Installation
SKILL.md
ZenStack V3 — Querying
The ZenStack client exposes a Prisma-compatible ORM API for everyday queries plus a Kysely
query builder ($qb) for anything SQL-shaped that the ORM API can't express. Schema syntax is in
zenstack-schema-modeling; access control in zenstack-access-control.
Creating the client
Import ZenStackClient from @zenstackhq/orm, pass the generated schema plus a Kysely dialect.
Install the matching driver yourself (see zenstack-project-setup).
SQLite (better-sqlite3):
import { ZenStackClient } from '@zenstackhq/orm';
import { SqliteDialect } from '@zenstackhq/orm/dialects/sqlite';
import SQLite from 'better-sqlite3';
import { schema } from './zenstack/schema';