Skip to content

Commit 88e4381

Browse files
authored
chore: misc changes (#192)
1 parent cd6ccb4 commit 88e4381

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
- [x] Compound ID
7878
- [ ] Cross field comparison
7979
- [x] Many-to-many relation
80-
- [ ] Self relation
80+
- [x] Self relation
8181
- [ ] Empty AND/OR/NOT behavior
8282
- [x] Logging
8383
- [x] Error system

packages/runtime/test/schemas/typing/schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export const schema = {
8080
email: { type: "String" }
8181
},
8282
computedFields: {
83-
postCount(): OperandExpression<number> {
83+
postCount(_context: {
84+
currentModel: string;
85+
}): OperandExpression<number> {
8486
throw new Error("This is a stub for computed field");
8587
}
8688
}

packages/runtime/test/schemas/typing/typecheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const client = new ZenStackClient(schema, {
1111
postCount: (eb) =>
1212
eb
1313
.selectFrom('Post')
14-
.whereRef('Post.authorId', '=', 'User.id')
14+
.whereRef('Post.authorId', '=', 'id')
1515
.select(({ fn }) => fn.countAll<number>().as('postCount')),
1616
},
1717
},

samples/blog/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { schema } from './zenstack/schema';
66
async function main() {
77
const db = new ZenStackClient(schema, {
88
dialect: new SqliteDialect({ database: new SQLite('./zenstack/dev.db') }),
9-
log: ['query'],
109
computedFields: {
1110
User: {
1211
postCount: (eb, { currentModel }) =>

0 commit comments

Comments
 (0)