mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
* feat(cli): implement watch mode for generate * chore(root): update pnpm-lock.yaml * chore(cli): track all model declaration and removed paths, logs in past tense * fix(cli): typo, unused double array from * fix(orm): preserve zod validation errors when validating custom json types * update * chore(cli): move import, fix parallel generation on watch * feat(common-helpers): implement single-debounce * chore(cli): use single-debounce for debouncing * feat(common-helpers): implement single-debounce * fix(common-helpers): re run single-debounce * fix(tanstack): avoid invalidating queries for custom proc mutations * add missing file * fix formatting --------- Co-authored-by: FTB_lag <tabolskyy.git@gmail.com>
25 lines
745 B
TypeScript
25 lines
745 B
TypeScript
import { schema } from '@/zenstack/schema';
|
|
import { ZenStackClient } from '@zenstackhq/orm';
|
|
import { SqliteDialect } from '@zenstackhq/orm/dialects/sqlite';
|
|
import SQLite from 'better-sqlite3';
|
|
|
|
export const db = new ZenStackClient(schema, {
|
|
dialect: new SqliteDialect({
|
|
database: new SQLite('./zenstack/dev.db'),
|
|
}),
|
|
procedures: {
|
|
signUp: ({ client, args }) =>
|
|
client.user.create({
|
|
data: { ...args },
|
|
}),
|
|
listPublicPosts: ({ client }) =>
|
|
client.post.findMany({
|
|
where: {
|
|
published: true,
|
|
},
|
|
orderBy: {
|
|
updatedAt: 'desc',
|
|
},
|
|
}),
|
|
},
|
|
});
|