Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
- [x] Compound ID
- [ ] Cross field comparison
- [x] Many-to-many relation
- [ ] Self relation
- [x] Self relation
- [ ] Empty AND/OR/NOT behavior
- [x] Logging
- [x] Error system
Expand Down
4 changes: 3 additions & 1 deletion packages/runtime/test/schemas/typing/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export const schema = {
email: { type: "String" }
},
computedFields: {
postCount(): OperandExpression<number> {
postCount(_context: {
currentModel: string;
}): OperandExpression<number> {
throw new Error("This is a stub for computed field");
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/test/schemas/typing/typecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const client = new ZenStackClient(schema, {
postCount: (eb) =>
eb
.selectFrom('Post')
.whereRef('Post.authorId', '=', 'User.id')
.whereRef('Post.authorId', '=', 'id')
.select(({ fn }) => fn.countAll<number>().as('postCount')),
},
},
Expand Down
1 change: 0 additions & 1 deletion samples/blog/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { schema } from './zenstack/schema';
async function main() {
const db = new ZenStackClient(schema, {
dialect: new SqliteDialect({ database: new SQLite('./zenstack/dev.db') }),
log: ['query'],
computedFields: {
User: {
postCount: (eb, { currentModel }) =>
Expand Down