File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -342,11 +342,17 @@ export function testSql(
342342
343343testSql . 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments