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
4 changes: 2 additions & 2 deletions packages/orm/src/client/crud/dialects/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class SqliteCrudDialect<Schema extends SchemaDef> extends BaseCrudDialect
'SQLite "array_contains" only supports checking for a single value, not an array of values',
);
} else {
return sql<any>`EXISTS (SELECT 1 FROM jsonb_each(${lhs}) WHERE value = ${value})`;
return sql<any>`EXISTS (SELECT 1 FROM json_each(${lhs}) WHERE value = ${value})`;
}
})
.with('array_starts_with', () =>
Expand All @@ -398,7 +398,7 @@ export class SqliteCrudDialect<Schema extends SchemaDef> extends BaseCrudDialect
) {
return this.eb.exists(
this.eb
.selectFrom(this.eb.fn('jsonb_each', [receiver]).as('$items'))
.selectFrom(this.eb.fn('json_each', [receiver]).as('$items'))
.select(this.eb.lit(1).as('$t'))
.where(buildFilter(this.eb.ref('$items.value'))),
);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/aggregate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Client aggregate tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/count.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client count tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/create-many-and-return.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client createManyAndReturn tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/create-many.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client createMany tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client create tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/delete-many.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client deleteMany tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client delete tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/find.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Client find tests ', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/group-by.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Client groupBy tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/raw-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client raw query tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client raw query tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/undefined-values.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Client undefined values tests ', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/update-many.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Client updateMany tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/client-api/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Client update tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/plugin-infra/on-kysely-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('On kysely query tests', () => {
let _client: ClientContract<typeof schema>;

beforeEach(async () => {
_client = (await createTestClient(schema)) as any;
_client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/plugin-infra/on-query-hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('On query hooks tests', () => {
let _client: ClientContract<typeof schema>;

beforeEach(async () => {
_client = (await createTestClient(schema)) as any;
_client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/orm/policy/basic-schema-read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Read policy tests', () => {
let client: ClientContract<typeof schema>;

beforeEach(async () => {
client = (await createTestClient(schema)) as any;
client = await createTestClient(schema);
});

afterEach(async () => {
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/orm/policy/policy-functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('policy functions tests', () => {
@@allow('all', contains(string, 'a%'))
}
`,
{ debug: true },
);

await expect(db.foo.create({ data: { string: 'ab' } })).toBeRejectedByPolicy();
Expand Down