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<
601
601
this . url . searchParams . append ( column , `${ operator } .${ value } ` )
602
602
return this
603
603
}
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
- }
626
604
}
Original file line number Diff line number Diff line change 1
1
import PostgrestBuilder from './PostgrestBuilder'
2
+ import { InvalidMethodError } from './PostgrestFilterBuilder'
2
3
import { GetResult } from './select-query-parser/result'
3
4
import { GenericSchema , CheckMatchingArrayTypes , ClientServerOptions } from './types'
4
5
@@ -338,4 +339,26 @@ export default class PostgrestTransformBuilder<
338
339
Method
339
340
>
340
341
}
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
+ }
341
364
}
You can’t perform that action at this time.
0 commit comments