Skip to content

Commit 5827be8

Browse files
committed
fix next branch following rebase.
1 parent 420796a commit 5827be8

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

test/node/src/test-setup.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,17 @@ export function testSql(
343343

344344
testSql.skip = function (
345345
_query: Compilable,
346-
_dialect: BuiltInDialect,
347-
_expectedPerDialect: PerDialect<{
346+
_dialect: DialectDescriptor,
347+
_expectedPerDialect: PerSQLDialect<{
348348
sql: string | string[]
349349
parameters: any[]
350-
}>,
350+
}> &
351+
Partial<
352+
Omit<
353+
PerDialectVariant<{ sql: string | string[]; parameters: any[] }>,
354+
keyof PerSQLDialect<any>
355+
>
356+
>,
351357
) {
352358
// noop
353359
}

test/node/src/with-schema.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,34 @@ for (const dialect of DIALECTS) {
277277

278278
await query.execute()
279279
})
280+
281+
for (const [selectModifierFn, clause] of [
282+
['forUpdate', 'for update'],
283+
['forShare', 'for share'],
284+
['forKeyShare', 'for key share'],
285+
['forNoKeyUpdate', 'for no key update'],
286+
] as const) {
287+
it(`should not add schema to ${clause} tables`, async () => {
288+
const query = ctx.db
289+
.withSchema('mammals')
290+
.selectFrom('pet')
291+
.selectAll()
292+
[selectModifierFn]('pet')
293+
.skipLocked()
294+
295+
testSql(query, dialect, {
296+
postgres: {
297+
sql: `select * from "mammals"."pet" ${clause} of "pet" skip locked`,
298+
parameters: [],
299+
},
300+
mysql: NOT_SUPPORTED,
301+
mssql: NOT_SUPPORTED,
302+
sqlite: NOT_SUPPORTED,
303+
})
304+
305+
await query.execute()
306+
})
307+
}
280308
}
281309
})
282310

0 commit comments

Comments
 (0)