This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-22
lines changed
Expand file tree Collapse file tree 2 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -601,26 +601,4 @@ export default class PostgrestFilterBuilder<
601601 this . url . searchParams . append ( column , `${ operator } .${ value } ` )
602602 return this
603603 }
604-
605- /**
606- * Set the maximum number of rows that can be affected by the query.
607- * Only available in PostgREST v13+ and only works with PATCH and DELETE methods.
608- *
609- * @param value - The maximum number of rows that can be affected
610- */
611- maxAffected (
612- value : number
613- ) : ClientOptions [ 'postgrestVersion' ] extends 13
614- ? Method extends 'PATCH' | 'DELETE'
615- ? this
616- : InvalidMethodError < 'maxAffected method only available on update or delete' >
617- : InvalidMethodError < 'maxAffected method only available on postgrest 13+' > {
618- this . headers . append ( 'Prefer' , 'handling=strict' )
619- this . headers . append ( 'Prefer' , `max-affected=${ value } ` )
620- return this as unknown as ClientOptions [ 'postgrestVersion' ] extends 13
621- ? Method extends 'PATCH' | 'DELETE'
622- ? this
623- : InvalidMethodError < 'maxAffected method only available on update or delete' >
624- : InvalidMethodError < 'maxAffected method only available on postgrest 13+' >
625- }
626604}
Original file line number Diff line number Diff line change 11import PostgrestBuilder from './PostgrestBuilder'
2+ import { InvalidMethodError } from './PostgrestFilterBuilder'
23import { GetResult } from './select-query-parser/result'
34import { GenericSchema , CheckMatchingArrayTypes , ClientServerOptions } from './types'
45
@@ -338,4 +339,26 @@ export default class PostgrestTransformBuilder<
338339 Method
339340 >
340341 }
342+
343+ /**
344+ * Set the maximum number of rows that can be affected by the query.
345+ * Only available in PostgREST v13+ and only works with PATCH and DELETE methods.
346+ *
347+ * @param value - The maximum number of rows that can be affected
348+ */
349+ maxAffected (
350+ value : number
351+ ) : ClientOptions [ 'postgrestVersion' ] extends 13
352+ ? Method extends 'PATCH' | 'DELETE'
353+ ? this
354+ : InvalidMethodError < 'maxAffected method only available on update or delete' >
355+ : InvalidMethodError < 'maxAffected method only available on postgrest 13+' > {
356+ this . headers . append ( 'Prefer' , 'handling=strict' )
357+ this . headers . append ( 'Prefer' , `max-affected=${ value } ` )
358+ return this as unknown as ClientOptions [ 'postgrestVersion' ] extends 13
359+ ? Method extends 'PATCH' | 'DELETE'
360+ ? this
361+ : InvalidMethodError < 'maxAffected method only available on update or delete' >
362+ : InvalidMethodError < 'maxAffected method only available on postgrest 13+' >
363+ }
341364}
You can’t perform that action at this time.
0 commit comments