File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,11 +343,17 @@ export function testSql(
343343
344344testSql . 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}
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