Skip to content

Commit fe54e42

Browse files
authored
chore(policy): more test cases and update (#246)
* chore(policy): more test cases and update * fix update regression * optimize nested relation manipulation
1 parent f01bcde commit fe54e42

File tree

13 files changed

+709
-178
lines changed

13 files changed

+709
-178
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</a>
2222
</div>
2323

24-
> V3 is currently in alpha phase and not ready for production use. Feedback and bug reports are greatly appreciated. Please visit this dedicated [discord channel](https://discord.com/channels/1035538056146595961/1352359627525718056) for chat and support.
24+
> V3 is currently in beta phase and not ready for production use. Feedback and bug reports are greatly appreciated. Please visit this dedicated [discord channel](https://discord.com/channels/1035538056146595961/1352359627525718056) for chat and support.
2525
2626
# What's ZenStack
2727

packages/runtime/src/client/crud/dialects/base.ts renamed to packages/runtime/src/client/crud/dialects/base-dialect.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ export abstract class BaseCrudDialect<Schema extends SchemaDef> {
11041104
return (node as ValueNode).value === false || (node as ValueNode).value === 0;
11051105
}
11061106

1107-
protected and(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
1107+
and(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
11081108
const nonTrueArgs = args.filter((arg) => !this.isTrue(arg));
11091109
if (nonTrueArgs.length === 0) {
11101110
return this.true(eb);
@@ -1115,7 +1115,7 @@ export abstract class BaseCrudDialect<Schema extends SchemaDef> {
11151115
}
11161116
}
11171117

1118-
protected or(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
1118+
or(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
11191119
const nonFalseArgs = args.filter((arg) => !this.isFalse(arg));
11201120
if (nonFalseArgs.length === 0) {
11211121
return this.false(eb);
@@ -1126,7 +1126,7 @@ export abstract class BaseCrudDialect<Schema extends SchemaDef> {
11261126
}
11271127
}
11281128

1129-
protected not(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
1129+
not(eb: ExpressionBuilder<any, any>, ...args: Expression<SqlBool>[]) {
11301130
return eb.not(this.and(eb, ...args));
11311131
}
11321132

packages/runtime/src/client/crud/dialects/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { match } from 'ts-pattern';
22
import type { SchemaDef } from '../../../schema';
33
import type { ClientOptions } from '../../options';
4-
import type { BaseCrudDialect } from './base';
4+
import type { BaseCrudDialect } from './base-dialect';
55
import { PostgresCrudDialect } from './postgresql';
66
import { SqliteCrudDialect } from './sqlite';
77

packages/runtime/src/client/crud/dialects/postgresql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
requireField,
2121
requireModel,
2222
} from '../../query-utils';
23-
import { BaseCrudDialect } from './base';
23+
import { BaseCrudDialect } from './base-dialect';
2424

2525
export class PostgresCrudDialect<Schema extends SchemaDef> extends BaseCrudDialect<Schema> {
2626
override get provider() {

packages/runtime/src/client/crud/dialects/sqlite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
requireField,
2121
requireModel,
2222
} from '../../query-utils';
23-
import { BaseCrudDialect } from './base';
23+
import { BaseCrudDialect } from './base-dialect';
2424

2525
export class SqliteCrudDialect<Schema extends SchemaDef> extends BaseCrudDialect<Schema> {
2626
override get provider() {

0 commit comments

Comments
 (0)