Skip to content

Commit c85d7c2

Browse files
committed
fix next branch following rebase.
1 parent f360739 commit c85d7c2

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

test/node/src/test-setup.ts

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

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

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)