@supabase/postgrest-js 2.100.0-rc.0 → 2.100.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -517,7 +517,7 @@ type ResolveForwardRelationship<Schema extends GenericSchema, Field$1 extends As
517
517
  * Given a CurrentTableOrView, finds all join tables to this relation.
518
518
  * For example, if products and categories are linked via product_categories table:
519
519
  *
520
- * @example
520
+ * @example Find join table relationship
521
521
  * Given:
522
522
  * - CurrentTableView = 'products'
523
523
  * - FieldName = "categories"
@@ -561,7 +561,7 @@ type JsonPathToType<T, Path extends string> = Path extends '' ? T : ContainsNull
561
561
  type IsStringUnion<T> = string extends T ? false : T extends string ? [T] extends [never] ? false : true : false;
562
562
  type MatchingFunctionBySetofFrom<Fn$1 extends GenericFunction, TableName$1 extends string> = Fn$1['SetofOptions'] extends GenericSetofOption ? TableName$1 extends Fn$1['SetofOptions']['from'] ? Fn$1 : never : false;
563
563
  type FindMatchingFunctionBySetofFrom<FnUnion, TableName$1 extends string> = FnUnion extends infer Fn extends GenericFunction ? MatchingFunctionBySetofFrom<Fn, TableName$1> : false;
564
- type ComputedField<Schema extends GenericSchema, RelationName extends keyof TablesAndViews$2<Schema>, FieldName$1 extends keyof TablesAndViews$2<Schema>[RelationName]['Row']> = FieldName$1 extends keyof Schema['Functions'] ? Schema['Functions'][FieldName$1] extends {
564
+ type ComputedField<Schema extends GenericSchema, RelationName extends keyof TablesAndViews$2<Schema>, FieldName$1 extends keyof TablesAndViews$2<Schema>[RelationName]['Row']> = FieldName$1 extends keyof Schema['Functions'] ? [Schema['Functions'][FieldName$1]['Args']] extends [never] ? never : Schema['Functions'][FieldName$1] extends {
565
565
  Args: {
566
566
  '': TablesAndViews$2<Schema>[RelationName]['Row'];
567
567
  };
@@ -638,7 +638,19 @@ declare abstract class PostgrestBuilder<ClientOptions extends ClientServerOption
638
638
  *
639
639
  * @example
640
640
  * ```ts
641
- * import PostgrestQueryBuilder from '@supabase/postgrest-js'
641
+ * import { PostgrestQueryBuilder } from '@supabase/postgrest-js'
642
+ *
643
+ * const builder = new PostgrestQueryBuilder(
644
+ * new URL('https://xyzcompany.supabase.co/rest/v1/users'),
645
+ * { headers: new Headers({ apikey: 'public-anon-key' }) }
646
+ * )
647
+ * ```
648
+ *
649
+ * @category Database
650
+ *
651
+ * @example Creating a Postgrest query builder
652
+ * ```ts
653
+ * import { PostgrestQueryBuilder } from '@supabase/postgrest-js'
642
654
  *
643
655
  * const builder = new PostgrestQueryBuilder(
644
656
  * new URL('https://xyzcompany.supabase.co/rest/v1/users'),
@@ -663,18 +675,27 @@ declare abstract class PostgrestBuilder<ClientOptions extends ClientServerOption
663
675
  * throwing the error instead of returning it as part of a successful response.
664
676
  *
665
677
  * {@link https://github.com/supabase/supabase-js/issues/92}
678
+ *
679
+ * @category Database
666
680
  */
667
681
  throwOnError(): this & PostgrestBuilder<ClientOptions, Result$1, true>;
668
682
  /**
669
683
  * Set an HTTP header for the request.
684
+ *
685
+ * @category Database
670
686
  */
671
687
  setHeader(name: string, value: string): this;
688
+ /** *
689
+ * @category Database
690
+ */
672
691
  then<TResult1 = (ThrowOnError extends true ? PostgrestResponseSuccess<Result$1> : PostgrestSingleResponse<Result$1>), TResult2 = never>(onfulfilled?: ((value: ThrowOnError extends true ? PostgrestResponseSuccess<Result$1> : PostgrestSingleResponse<Result$1>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
673
692
  /**
674
693
  * Override the type of the returned `data`.
675
694
  *
676
695
  * @typeParam NewResult - The new result type to override with
677
696
  * @deprecated Use overrideTypes<yourType, { merge: false }>() method at the end of your call chain instead
697
+ *
698
+ * @category Database
678
699
  */
679
700
  returns<NewResult>(): PostgrestBuilder<ClientOptions, CheckMatchingArrayTypes<Result$1, NewResult>, ThrowOnError>;
680
701
  /**
@@ -698,6 +719,77 @@ declare abstract class PostgrestBuilder<ClientOptions extends ClientServerOption
698
719
  * .overrideTypes<{ id: number; name: string }, { merge: false }>()
699
720
  * ```
700
721
  * @returns A PostgrestBuilder instance with the new type
722
+ *
723
+ * @category Database
724
+ *
725
+ * @example Complete Override type of successful response
726
+ * ```ts
727
+ * const { data } = await supabase
728
+ * .from('countries')
729
+ * .select()
730
+ * .overrideTypes<Array<MyType>, { merge: false }>()
731
+ * ```
732
+ *
733
+ * @exampleResponse Complete Override type of successful response
734
+ * ```ts
735
+ * let x: typeof data // MyType[]
736
+ * ```
737
+ *
738
+ * @example Complete Override type of object response
739
+ * ```ts
740
+ * const { data } = await supabase
741
+ * .from('countries')
742
+ * .select()
743
+ * .maybeSingle()
744
+ * .overrideTypes<MyType, { merge: false }>()
745
+ * ```
746
+ *
747
+ * @exampleResponse Complete Override type of object response
748
+ * ```ts
749
+ * let x: typeof data // MyType | null
750
+ * ```
751
+ *
752
+ * @example Partial Override type of successful response
753
+ * ```ts
754
+ * const { data } = await supabase
755
+ * .from('countries')
756
+ * .select()
757
+ * .overrideTypes<Array<{ status: "A" | "B" }>>()
758
+ * ```
759
+ *
760
+ * @exampleResponse Partial Override type of successful response
761
+ * ```ts
762
+ * let x: typeof data // Array<CountryRowProperties & { status: "A" | "B" }>
763
+ * ```
764
+ *
765
+ * @example Partial Override type of object response
766
+ * ```ts
767
+ * const { data } = await supabase
768
+ * .from('countries')
769
+ * .select()
770
+ * .maybeSingle()
771
+ * .overrideTypes<{ status: "A" | "B" }>()
772
+ * ```
773
+ *
774
+ * @exampleResponse Partial Override type of object response
775
+ * ```ts
776
+ * let x: typeof data // CountryRowProperties & { status: "A" | "B" } | null
777
+ * ```
778
+ *
779
+ * @example Example 5
780
+ * ```typescript
781
+ * // Merge with existing types (default behavior)
782
+ * const query = supabase
783
+ * .from('users')
784
+ * .select()
785
+ * .overrideTypes<{ custom_field: string }>()
786
+ *
787
+ * // Replace existing types completely
788
+ * const replaceQuery = supabase
789
+ * .from('users')
790
+ * .select()
791
+ * .overrideTypes<{ id: number; name: string }, { merge: false }>()
792
+ * ```
701
793
  */
702
794
  overrideTypes<NewResult, Options extends {
703
795
  merge?: boolean;
@@ -849,6 +941,41 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
849
941
  * `data`.
850
942
  *
851
943
  * @param columns - The columns to retrieve, separated by commas
944
+ *
945
+ * @category Database
946
+ *
947
+ * @example With `upsert()`
948
+ * ```ts
949
+ * const { data, error } = await supabase
950
+ * .from('characters')
951
+ * .upsert({ id: 1, name: 'Han Solo' })
952
+ * .select()
953
+ * ```
954
+ *
955
+ * @exampleSql With `upsert()`
956
+ * ```sql
957
+ * create table
958
+ * characters (id int8 primary key, name text);
959
+ *
960
+ * insert into
961
+ * characters (id, name)
962
+ * values
963
+ * (1, 'Han');
964
+ * ```
965
+ *
966
+ * @exampleResponse With `upsert()`
967
+ * ```json
968
+ * {
969
+ * "data": [
970
+ * {
971
+ * "id": 1,
972
+ * "name": "Han Solo"
973
+ * }
974
+ * ],
975
+ * "status": 201,
976
+ * "statusText": "Created"
977
+ * }
978
+ * ```
852
979
  */
853
980
  select<Query extends string = '*', NewResultOne = GetResult<Schema, Row, RelationName, Relationships, Query, ClientOptions>>(columns?: Query): PostgrestFilterBuilder<ClientOptions, Schema, Row, Method extends 'RPC' ? Result$1 extends unknown[] ? NewResultOne[] : NewResultOne : NewResultOne[], RelationName, Relationships, Method>;
854
981
  order<ColumnName extends string & keyof Row>(column: ColumnName, options?: {
@@ -886,6 +1013,95 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
886
1013
  * tables instead of the parent table
887
1014
  * @param options.foreignTable - Deprecated, use `options.referencedTable`
888
1015
  * instead
1016
+ *
1017
+ * @category Database
1018
+ *
1019
+ * @example With `select()`
1020
+ * ```ts
1021
+ * const { data, error } = await supabase
1022
+ * .from('characters')
1023
+ * .select('name')
1024
+ * .limit(1)
1025
+ * ```
1026
+ *
1027
+ * @exampleSql With `select()`
1028
+ * ```sql
1029
+ * create table
1030
+ * characters (id int8 primary key, name text);
1031
+ *
1032
+ * insert into
1033
+ * characters (id, name)
1034
+ * values
1035
+ * (1, 'Luke'),
1036
+ * (2, 'Leia'),
1037
+ * (3, 'Han');
1038
+ * ```
1039
+ *
1040
+ * @exampleResponse With `select()`
1041
+ * ```json
1042
+ * {
1043
+ * "data": [
1044
+ * {
1045
+ * "name": "Luke"
1046
+ * }
1047
+ * ],
1048
+ * "status": 200,
1049
+ * "statusText": "OK"
1050
+ * }
1051
+ * ```
1052
+ *
1053
+ * @example On a referenced table
1054
+ * ```ts
1055
+ * const { data, error } = await supabase
1056
+ * .from('orchestral_sections')
1057
+ * .select(`
1058
+ * name,
1059
+ * instruments (
1060
+ * name
1061
+ * )
1062
+ * `)
1063
+ * .limit(1, { referencedTable: 'instruments' })
1064
+ * ```
1065
+ *
1066
+ * @exampleSql On a referenced table
1067
+ * ```sql
1068
+ * create table
1069
+ * orchestral_sections (id int8 primary key, name text);
1070
+ * create table
1071
+ * instruments (
1072
+ * id int8 primary key,
1073
+ * section_id int8 not null references orchestral_sections,
1074
+ * name text
1075
+ * );
1076
+ *
1077
+ * insert into
1078
+ * orchestral_sections (id, name)
1079
+ * values
1080
+ * (1, 'strings');
1081
+ * insert into
1082
+ * instruments (id, section_id, name)
1083
+ * values
1084
+ * (1, 1, 'harp'),
1085
+ * (2, 1, 'violin');
1086
+ * ```
1087
+ *
1088
+ * @exampleResponse On a referenced table
1089
+ * ```json
1090
+ * {
1091
+ * "data": [
1092
+ * {
1093
+ * "name": "strings",
1094
+ * "instruments": [
1095
+ * {
1096
+ * "name": "violin"
1097
+ * }
1098
+ * ]
1099
+ * }
1100
+ * ],
1101
+ * "status": 200,
1102
+ * "statusText": "OK"
1103
+ * }
1104
+ * ```
889
1105
  */
890
1106
  limit(count: number, {
891
1107
  foreignTable,
@@ -908,6 +1124,45 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
908
1124
  * tables instead of the parent table
909
1125
  * @param options.foreignTable - Deprecated, use `options.referencedTable`
910
1126
  * instead
1127
+ *
1128
+ * @category Database
1129
+ *
1130
+ * @example With `select()`
1131
+ * ```ts
1132
+ * const { data, error } = await supabase
1133
+ * .from('characters')
1134
+ * .select('name')
1135
+ * .range(0, 1)
1136
+ * ```
1137
+ *
1138
+ * @exampleSql With `select()`
1139
+ * ```sql
1140
+ * create table
1141
+ * characters (id int8 primary key, name text);
1142
+ *
1143
+ * insert into
1144
+ * characters (id, name)
1145
+ * values
1146
+ * (1, 'Luke'),
1147
+ * (2, 'Leia'),
1148
+ * (3, 'Han');
1149
+ * ```
1150
+ *
1151
+ * @exampleResponse With `select()`
1152
+ * ```json
1153
+ * {
1154
+ * "data": [
1155
+ * {
1156
+ * "name": "Luke"
1157
+ * },
1158
+ * {
1159
+ * "name": "Leia"
1160
+ * }
1161
+ * ],
1162
+ * "status": 200,
1163
+ * "statusText": "OK"
1164
+ * }
1165
+ * ```
911
1166
  */
912
1167
  range(from: number, to: number, {
913
1168
  foreignTable,
@@ -920,6 +1175,66 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
920
1175
  * Set the AbortSignal for the fetch request.
921
1176
  *
922
1177
  * @param signal - The AbortSignal to use for the fetch request
1178
+ *
1179
+ * @category Database
1180
+ *
1181
+ * @remarks
1182
+ * You can use this to set a timeout for the request.
1183
+ *
1184
+ * @exampleDescription Aborting requests in-flight
1185
+ * You can use an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) to abort requests.
1186
+ * Note that `status` and `statusText` don't mean anything for aborted requests as the request wasn't fulfilled.
1187
+ *
1188
+ * @example Aborting requests in-flight
1189
+ * ```ts
1190
+ * const ac = new AbortController()
1191
+ *
1192
+ * const { data, error } = await supabase
1193
+ * .from('very_big_table')
1194
+ * .select()
1195
+ * .abortSignal(ac.signal)
1196
+ *
1197
+ * // Abort the request after 100 ms
1198
+ * setTimeout(() => ac.abort(), 100)
1199
+ * ```
1200
+ *
1201
+ * @exampleResponse Aborting requests in-flight
1202
+ * ```json
1203
+ * {
1204
+ * "error": {
1205
+ * "message": "AbortError: The user aborted a request.",
1206
+ * "details": "",
1207
+ * "hint": "The request was aborted locally via the provided AbortSignal.",
1208
+ * "code": ""
1209
+ * },
1210
+ * "status": 0,
1211
+ * "statusText": ""
1212
+ * }
1213
+ *
1214
+ * ```
1215
+ *
1216
+ * @example Set a timeout
1217
+ * ```ts
1218
+ * const { data, error } = await supabase
1219
+ * .from('very_big_table')
1220
+ * .select()
1221
+ * .abortSignal(AbortSignal.timeout(1000 /* ms *\/))
1222
+ * ```
1223
+ *
1224
+ * @exampleResponse Set a timeout
1225
+ * ```json
1226
+ * {
1227
+ * "error": {
1228
+ * "message": "FetchError: The user aborted a request.",
1229
+ * "details": "",
1230
+ * "hint": "",
1231
+ * "code": ""
1232
+ * },
1233
+ * "status": 400,
1234
+ * "statusText": "Bad Request"
1235
+ * }
1236
+ *
1237
+ * ```
923
1238
  */
924
1239
  abortSignal(signal: AbortSignal): this;
925
1240
  /**
@@ -927,6 +1242,41 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
927
1242
  *
928
1243
  * Query result must be one row (e.g. using `.limit(1)`), otherwise this
929
1244
  * returns an error.
1245
+ *
1246
+ * @category Database
1247
+ *
1248
+ * @example With `select()`
1249
+ * ```ts
1250
+ * const { data, error } = await supabase
1251
+ * .from('characters')
1252
+ * .select('name')
1253
+ * .limit(1)
1254
+ * .single()
1255
+ * ```
1256
+ *
1257
+ * @exampleSql With `select()`
1258
+ * ```sql
1259
+ * create table
1260
+ * characters (id int8 primary key, name text);
1261
+ *
1262
+ * insert into
1263
+ * characters (id, name)
1264
+ * values
1265
+ * (1, 'Luke'),
1266
+ * (2, 'Leia'),
1267
+ * (3, 'Han');
1268
+ * ```
1269
+ *
1270
+ * @exampleResponse With `select()`
1271
+ * ```json
1272
+ * {
1273
+ * "data": {
1274
+ * "name": "Luke"
1275
+ * },
1276
+ * "status": 200,
1277
+ * "statusText": "OK"
1278
+ * }
1279
+ * ```
930
1280
  */
931
1281
  single<ResultOne = (Result$1 extends (infer ResultOne)[] ? ResultOne : never)>(): PostgrestBuilder<ClientOptions, ResultOne>;
932
1282
  /**
@@ -934,14 +1284,83 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
934
1284
  *
935
1285
  * Query result must be zero or one row (e.g. using `.limit(1)`), otherwise
936
1286
  * this returns an error.
1287
+ *
1288
+ * @category Database
1289
+ *
1290
+ * @example With `select()`
1291
+ * ```ts
1292
+ * const { data, error } = await supabase
1293
+ * .from('characters')
1294
+ * .select()
1295
+ * .eq('name', 'Katniss')
1296
+ * .maybeSingle()
1297
+ * ```
1298
+ *
1299
+ * @exampleSql With `select()`
1300
+ * ```sql
1301
+ * create table
1302
+ * characters (id int8 primary key, name text);
1303
+ *
1304
+ * insert into
1305
+ * characters (id, name)
1306
+ * values
1307
+ * (1, 'Luke'),
1308
+ * (2, 'Leia'),
1309
+ * (3, 'Han');
1310
+ * ```
1311
+ *
1312
+ * @exampleResponse With `select()`
1313
+ * ```json
1314
+ * {
1315
+ * "status": 200,
1316
+ * "statusText": "OK"
1317
+ * }
1318
+ * ```
937
1319
  */
938
1320
  maybeSingle<ResultOne = (Result$1 extends (infer ResultOne)[] ? ResultOne : never)>(): PostgrestBuilder<ClientOptions, ResultOne | null>;
939
1321
  /**
940
1322
  * Return `data` as a string in CSV format.
1323
+ *
1324
+ * @category Database
1325
+ *
1326
+ * @exampleDescription Return data as CSV
1327
+ * By default, the data is returned in JSON format, but can also be returned as Comma Separated Values.
1328
+ *
1329
+ * @example Return data as CSV
1330
+ * ```ts
1331
+ * const { data, error } = await supabase
1332
+ * .from('characters')
1333
+ * .select()
1334
+ * .csv()
1335
+ * ```
1336
+ *
1337
+ * @exampleSql Return data as CSV
1338
+ * ```sql
1339
+ * create table
1340
+ * characters (id int8 primary key, name text);
1341
+ *
1342
+ * insert into
1343
+ * characters (id, name)
1344
+ * values
1345
+ * (1, 'Luke'),
1346
+ * (2, 'Leia'),
1347
+ * (3, 'Han');
1348
+ * ```
1349
+ *
1350
+ * @exampleResponse Return data as CSV
1351
+ * ```json
1352
+ * {
1353
+ * "data": "id,name\n1,Luke\n2,Leia\n3,Han",
1354
+ * "status": 200,
1355
+ * "statusText": "OK"
1356
+ * }
1357
+ * ```
941
1358
  */
942
1359
  csv(): PostgrestBuilder<ClientOptions, string>;
943
1360
  /**
944
1361
  * Return `data` as an object in [GeoJSON](https://geojson.org) format.
1362
+ *
1363
+ * @category Database
945
1364
  */
946
1365
  geojson(): PostgrestBuilder<ClientOptions, Record<string, unknown>>;
947
1366
  /**
@@ -968,6 +1387,76 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
968
1387
  *
969
1388
  * @param options.format - The format of the output, can be `"text"` (default)
970
1389
  * or `"json"`
1390
+ *
1391
+ * @category Database
1392
+ *
1393
+ * @exampleDescription Get the execution plan
1394
+ * By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.
1395
+ *
1396
+ * @example Get the execution plan
1397
+ * ```ts
1398
+ * const { data, error } = await supabase
1399
+ * .from('characters')
1400
+ * .select()
1401
+ * .explain()
1402
+ * ```
1403
+ *
1404
+ * @exampleSql Get the execution plan
1405
+ * ```sql
1406
+ * create table
1407
+ * characters (id int8 primary key, name text);
1408
+ *
1409
+ * insert into
1410
+ * characters (id, name)
1411
+ * values
1412
+ * (1, 'Luke'),
1413
+ * (2, 'Leia'),
1414
+ * (3, 'Han');
1415
+ * ```
1416
+ *
1417
+ * @exampleResponse Get the execution plan
1418
+ * ```js
1419
+ * Aggregate (cost=33.34..33.36 rows=1 width=112)
1420
+ * -> Limit (cost=0.00..18.33 rows=1000 width=40)
1421
+ * -> Seq Scan on characters (cost=0.00..22.00 rows=1200 width=40)
1422
+ * ```
1423
+ *
1424
+ * @exampleDescription Get the execution plan with analyze and verbose
1425
+ * By default, the data is returned in TEXT format, but can also be returned as JSON by using the `format` parameter.
1426
+ *
1427
+ * @example Get the execution plan with analyze and verbose
1428
+ * ```ts
1429
+ * const { data, error } = await supabase
1430
+ * .from('characters')
1431
+ * .select()
1432
+ * .explain({analyze:true,verbose:true})
1433
+ * ```
1434
+ *
1435
+ * @exampleSql Get the execution plan with analyze and verbose
1436
+ * ```sql
1437
+ * create table
1438
+ * characters (id int8 primary key, name text);
1439
+ *
1440
+ * insert into
1441
+ * characters (id, name)
1442
+ * values
1443
+ * (1, 'Luke'),
1444
+ * (2, 'Leia'),
1445
+ * (3, 'Han');
1446
+ * ```
1447
+ *
1448
+ * @exampleResponse Get the execution plan with analyze and verbose
1449
+ * ```js
1450
+ * Aggregate (cost=33.34..33.36 rows=1 width=112) (actual time=0.041..0.041 rows=1 loops=1)
1451
+ * Output: NULL::bigint, count(ROW(characters.id, characters.name)), COALESCE(json_agg(ROW(characters.id, characters.name)), '[]'::json), NULLIF(current_setting('response.headers'::text, true), ''::text), NULLIF(current_setting('response.status'::text, true), ''::text)
1452
+ * -> Limit (cost=0.00..18.33 rows=1000 width=40) (actual time=0.005..0.006 rows=3 loops=1)
1453
+ * Output: characters.id, characters.name
1454
+ * -> Seq Scan on public.characters (cost=0.00..22.00 rows=1200 width=40) (actual time=0.004..0.005 rows=3 loops=1)
1455
+ * Output: characters.id, characters.name
1456
+ * Query Identifier: -4730654291623321173
1457
+ * Planning Time: 0.407 ms
1458
+ * Execution Time: 0.119 ms
1459
+ * ```
971
1460
  */
972
1461
  explain({
973
1462
  analyze,
@@ -988,6 +1477,8 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
988
1477
  * Rollback the query.
989
1478
  *
990
1479
  * `data` will still be returned, but the query is not committed.
1480
+ *
1481
+ * @category Database
991
1482
  */
992
1483
  rollback(): this;
993
1484
  /**
@@ -995,6 +1486,38 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
995
1486
  *
996
1487
  * @typeParam NewResult - The new result type to override with
997
1488
  * @deprecated Use overrideTypes<yourType, { merge: false }>() method at the end of your call chain instead
1489
+ *
1490
+ * @category Database
1491
+ *
1492
+ * @remarks
1493
+ * - Deprecated: use overrideTypes method instead
1494
+ *
1495
+ * @example Override type of successful response
1496
+ * ```ts
1497
+ * const { data } = await supabase
1498
+ * .from('countries')
1499
+ * .select()
1500
+ * .returns<Array<MyType>>()
1501
+ * ```
1502
+ *
1503
+ * @exampleResponse Override type of successful response
1504
+ * ```js
1505
+ * let x: typeof data // MyType[]
1506
+ * ```
1507
+ *
1508
+ * @example Override type of object response
1509
+ * ```ts
1510
+ * const { data } = await supabase
1511
+ * .from('countries')
1512
+ * .select()
1513
+ * .maybeSingle()
1514
+ * .returns<MyType>()
1515
+ * ```
1516
+ *
1517
+ * @exampleResponse Override type of object response
1518
+ * ```js
1519
+ * let x: typeof data // MyType | null
1520
+ * ```
998
1521
  */
999
1522
  returns<NewResult>(): PostgrestTransformBuilder<ClientOptions, Schema, Row, CheckMatchingArrayTypes<Result$1, NewResult>, RelationName, Relationships, Method>;
1000
1523
  /**
@@ -1002,6 +1525,8 @@ declare class PostgrestTransformBuilder<ClientOptions extends ClientServerOption
1002
1525
  * Only available in PostgREST v13+ and only works with PATCH and DELETE methods.
1003
1526
  *
1004
1527
  * @param value - The maximum number of rows that can be affected
1528
+ *
1529
+ * @category Database
1005
1530
  */
1006
1531
  maxAffected(value: number): MaxAffectedEnabled<ClientOptions['PostgrestVersion']> extends true ? Method extends 'PATCH' | 'DELETE' | 'RPC' ? this : InvalidMethodError<'maxAffected method only available on update or delete'> : InvalidMethodError<'maxAffected method only available on postgrest 13+'>;
1007
1532
  }
@@ -1022,15 +1547,93 @@ declare class PostgrestFilterBuilder<ClientOptions extends ClientServerOptions,
1022
1547
  *
1023
1548
  * @param column - The column to filter on
1024
1549
  * @param value - The value to filter with
1550
+ *
1551
+ * @category Database
1552
+ *
1553
+ * @example With `select()`
1554
+ * ```ts
1555
+ * const { data, error } = await supabase
1556
+ * .from('characters')
1557
+ * .select()
1558
+ * .eq('name', 'Leia')
1559
+ * ```
1560
+ *
1561
+ * @exampleSql With `select()`
1562
+ * ```sql
1563
+ * create table
1564
+ * characters (id int8 primary key, name text);
1565
+ *
1566
+ * insert into
1567
+ * characters (id, name)
1568
+ * values
1569
+ * (1, 'Luke'),
1570
+ * (2, 'Leia'),
1571
+ * (3, 'Han');
1572
+ * ```
1573
+ *
1574
+ * @exampleResponse With `select()`
1575
+ * ```json
1576
+ * {
1577
+ * "data": [
1578
+ * {
1579
+ * "id": 2,
1580
+ * "name": "Leia"
1581
+ * }
1582
+ * ],
1583
+ * "status": 200,
1584
+ * "statusText": "OK"
1585
+ * }
1586
+ * ```
1025
1587
  */
1026
- eq<ColumnName extends string>(column: ColumnName, value: ResolveFilterValue<Schema, Row, ColumnName> extends never ? NonNullable<unknown> : ResolveFilterValue<Schema, Row, ColumnName> extends infer ResolvedFilterValue ? NonNullable<ResolvedFilterValue> : never): this;
1588
+ eq<ColumnName extends string>(column: ColumnName extends keyof Row ? ColumnName : ColumnName extends `${string}.${string}` | `${string}->${string}` ? ColumnName : string extends ColumnName ? string : keyof Row, value: ResolveFilterValue<Schema, Row, ColumnName> extends never ? NonNullable<unknown> : ResolveFilterValue<Schema, Row, ColumnName> extends infer ResolvedFilterValue ? NonNullable<ResolvedFilterValue> : never): this;
1027
1589
  /**
1028
1590
  * Match only rows where `column` is not equal to `value`.
1029
1591
  *
1030
1592
  * @param column - The column to filter on
1031
1593
  * @param value - The value to filter with
1594
+ *
1595
+ * @category Database
1596
+ *
1597
+ * @example With `select()`
1598
+ * ```ts
1599
+ * const { data, error } = await supabase
1600
+ * .from('characters')
1601
+ * .select()
1602
+ * .neq('name', 'Leia')
1603
+ * ```
1604
+ *
1605
+ * @exampleSql With `select()`
1606
+ * ```sql
1607
+ * create table
1608
+ * characters (id int8 primary key, name text);
1609
+ *
1610
+ * insert into
1611
+ * characters (id, name)
1612
+ * values
1613
+ * (1, 'Luke'),
1614
+ * (2, 'Leia'),
1615
+ * (3, 'Han');
1616
+ * ```
1617
+ *
1618
+ * @exampleResponse With `select()`
1619
+ * ```json
1620
+ * {
1621
+ * "data": [
1622
+ * {
1623
+ * "id": 1,
1624
+ * "name": "Luke"
1625
+ * },
1626
+ * {
1627
+ * "id": 3,
1628
+ * "name": "Han"
1629
+ * }
1630
+ * ],
1631
+ * "status": 200,
1632
+ * "statusText": "OK"
1633
+ * }
1634
+ * ```
1032
1635
  */
1033
- neq<ColumnName extends string>(column: ColumnName, value: ResolveFilterValue<Schema, Row, ColumnName> extends never ? unknown : ResolveFilterValue<Schema, Row, ColumnName> extends infer ResolvedFilterValue ? ResolvedFilterValue : never): this;
1636
+ neq<ColumnName extends string>(column: ColumnName extends keyof Row ? ColumnName : ColumnName extends `${string}.${string}` | `${string}->${string}` ? ColumnName : string extends ColumnName ? string : keyof Row, value: ResolveFilterValue<Schema, Row, ColumnName> extends never ? unknown : ResolveFilterValue<Schema, Row, ColumnName> extends infer Resolved ? Resolved : never): this;
1034
1637
  gt<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this;
1035
1638
  gt(column: string, value: unknown): this;
1036
1639
  gte<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this;
@@ -1071,8 +1674,49 @@ declare class PostgrestFilterBuilder<ClientOptions extends ClientServerOptions,
1071
1674
  /**
1072
1675
  * Match only rows where `column` is included in the `values` array.
1073
1676
  *
1074
- * @param column - The column to filter on
1075
- * @param values - The values array to filter with
1677
+ * @param column - The column to filter on
1678
+ * @param values - The values array to filter with
1679
+ *
1680
+ * @category Database
1681
+ *
1682
+ * @example With `select()`
1683
+ * ```ts
1684
+ * const { data, error } = await supabase
1685
+ * .from('characters')
1686
+ * .select()
1687
+ * .in('name', ['Leia', 'Han'])
1688
+ * ```
1689
+ *
1690
+ * @exampleSql With `select()`
1691
+ * ```sql
1692
+ * create table
1693
+ * characters (id int8 primary key, name text);
1694
+ *
1695
+ * insert into
1696
+ * characters (id, name)
1697
+ * values
1698
+ * (1, 'Luke'),
1699
+ * (2, 'Leia'),
1700
+ * (3, 'Han');
1701
+ * ```
1702
+ *
1703
+ * @exampleResponse With `select()`
1704
+ * ```json
1705
+ * {
1706
+ * "data": [
1707
+ * {
1708
+ * "id": 2,
1709
+ * "name": "Leia"
1710
+ * },
1711
+ * {
1712
+ * "id": 3,
1713
+ * "name": "Han"
1714
+ * }
1715
+ * ],
1716
+ * "status": 200,
1717
+ * "statusText": "OK"
1718
+ * }
1719
+ * ```
1076
1720
  */
1077
1721
  in<ColumnName extends string>(column: ColumnName, values: ReadonlyArray<ResolveFilterValue<Schema, Row, ColumnName> extends never ? unknown : ResolveFilterValue<Schema, Row, ColumnName> extends infer ResolvedFilterValue ? ResolvedFilterValue : never>): this;
1078
1722
  /**
@@ -1124,6 +1768,141 @@ declare class PostgrestFilterBuilder<ClientOptions extends ClientServerOptions,
1124
1768
  * @param options.referencedTable - Set this to filter on referenced tables
1125
1769
  * instead of the parent table
1126
1770
  * @param options.foreignTable - Deprecated, use `referencedTable` instead
1771
+ *
1772
+ * @category Database
1773
+ *
1774
+ * @remarks
1775
+ * or() expects you to use the raw PostgREST syntax for the filter names and values.
1776
+ *
1777
+ * ```ts
1778
+ * .or('id.in.(5,6,7), arraycol.cs.{"a","b"}') // Use `()` for `in` filter, `{}` for array values and `cs` for `contains()`.
1779
+ * .or('id.in.(5,6,7), arraycol.cd.{"a","b"}') // Use `cd` for `containedBy()`
1780
+ * ```
1781
+ *
1782
+ * @example With `select()`
1783
+ * ```ts
1784
+ * const { data, error } = await supabase
1785
+ * .from('characters')
1786
+ * .select('name')
1787
+ * .or('id.eq.2,name.eq.Han')
1788
+ * ```
1789
+ *
1790
+ * @exampleSql With `select()`
1791
+ * ```sql
1792
+ * create table
1793
+ * characters (id int8 primary key, name text);
1794
+ *
1795
+ * insert into
1796
+ * characters (id, name)
1797
+ * values
1798
+ * (1, 'Luke'),
1799
+ * (2, 'Leia'),
1800
+ * (3, 'Han');
1801
+ * ```
1802
+ *
1803
+ * @exampleResponse With `select()`
1804
+ * ```json
1805
+ * {
1806
+ * "data": [
1807
+ * {
1808
+ * "name": "Leia"
1809
+ * },
1810
+ * {
1811
+ * "name": "Han"
1812
+ * }
1813
+ * ],
1814
+ * "status": 200,
1815
+ * "statusText": "OK"
1816
+ * }
1817
+ * ```
1818
+ *
1819
+ * @example Use `or` with `and`
1820
+ * ```ts
1821
+ * const { data, error } = await supabase
1822
+ * .from('characters')
1823
+ * .select('name')
1824
+ * .or('id.gt.3,and(id.eq.1,name.eq.Luke)')
1825
+ * ```
1826
+ *
1827
+ * @exampleSql Use `or` with `and`
1828
+ * ```sql
1829
+ * create table
1830
+ * characters (id int8 primary key, name text);
1831
+ *
1832
+ * insert into
1833
+ * characters (id, name)
1834
+ * values
1835
+ * (1, 'Luke'),
1836
+ * (2, 'Leia'),
1837
+ * (3, 'Han');
1838
+ * ```
1839
+ *
1840
+ * @exampleResponse Use `or` with `and`
1841
+ * ```json
1842
+ * {
1843
+ * "data": [
1844
+ * {
1845
+ * "name": "Luke"
1846
+ * }
1847
+ * ],
1848
+ * "status": 200,
1849
+ * "statusText": "OK"
1850
+ * }
1851
+ * ```
1852
+ *
1853
+ * @example Use `or` on referenced tables
1854
+ * ```ts
1855
+ * const { data, error } = await supabase
1856
+ * .from('orchestral_sections')
1857
+ * .select(`
1858
+ * name,
1859
+ * instruments!inner (
1860
+ * name
1861
+ * )
1862
+ * `)
1863
+ * .or('section_id.eq.1,name.eq.guzheng', { referencedTable: 'instruments' })
1864
+ * ```
1865
+ *
1866
+ * @exampleSql Use `or` on referenced tables
1867
+ * ```sql
1868
+ * create table
1869
+ * orchestral_sections (id int8 primary key, name text);
1870
+ * create table
1871
+ * instruments (
1872
+ * id int8 primary key,
1873
+ * section_id int8 not null references orchestral_sections,
1874
+ * name text
1875
+ * );
1876
+ *
1877
+ * insert into
1878
+ * orchestral_sections (id, name)
1879
+ * values
1880
+ * (1, 'strings'),
1881
+ * (2, 'woodwinds');
1882
+ * insert into
1883
+ * instruments (id, section_id, name)
1884
+ * values
1885
+ * (1, 2, 'flute'),
1886
+ * (2, 1, 'violin');
1887
+ * ```
1888
+ *
1889
+ * @exampleResponse Use `or` on referenced tables
1890
+ * ```json
1891
+ * {
1892
+ * "data": [
1893
+ * {
1894
+ * "name": "strings",
1895
+ * "instruments": [
1896
+ * {
1897
+ * "name": "violin"
1898
+ * }
1899
+ * ]
1900
+ * }
1901
+ * ],
1902
+ * "status": 200,
1903
+ * "statusText": "OK"
1904
+ * }
1905
+ * ```
1127
1906
  */
1128
1907
  or(filters: string, {
1129
1908
  foreignTable,
@@ -1149,9 +1928,11 @@ declare class PostgrestQueryBuilder<ClientOptions extends ClientServerOptions, S
1149
1928
  /**
1150
1929
  * Creates a query builder scoped to a Postgres table or view.
1151
1930
  *
1152
- * @example
1931
+ * @category Database
1932
+ *
1933
+ * @example Creating a Postgrest query builder
1153
1934
  * ```ts
1154
- * import PostgrestQueryBuilder from '@supabase/postgrest-js'
1935
+ * import { PostgrestQueryBuilder } from '@supabase/postgrest-js'
1155
1936
  *
1156
1937
  * const query = new PostgrestQueryBuilder(
1157
1938
  * new URL('https://xyzcompany.supabase.co/rest/v1/users'),
@@ -2147,6 +2928,105 @@ declare class PostgrestQueryBuilder<ClientOptions extends ClientServerOptions, S
2147
2928
  *
2148
2929
  * `"estimated"`: Uses exact count for low numbers and planned count for high
2149
2930
  * numbers.
2931
+ *
2932
+ * @category Database
2933
+ *
2934
+ * @remarks
2935
+ * - `delete()` should always be combined with [filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete.
2936
+ * - If you use `delete()` with filters and you have
2937
+ * [RLS](/docs/learn/auth-deep-dive/auth-row-level-security) enabled, only
2938
+ * rows visible through `SELECT` policies are deleted. Note that by default
2939
+ * no rows are visible, so you need at least one `SELECT`/`ALL` policy that
2940
+ * makes the rows visible.
2941
+ * - When using `delete().in()`, specify an array of values to target multiple rows with a single query. This is particularly useful for batch deleting entries that share common criteria, such as deleting users by their IDs. Ensure that the array you provide accurately represents all records you intend to delete to avoid unintended data removal.
2942
+ *
2943
+ * @example Delete a single record
2944
+ * ```ts
2945
+ * const response = await supabase
2946
+ * .from('countries')
2947
+ * .delete()
2948
+ * .eq('id', 1)
2949
+ * ```
2950
+ *
2951
+ * @exampleSql Delete a single record
2952
+ * ```sql
2953
+ * create table
2954
+ * countries (id int8 primary key, name text);
2955
+ *
2956
+ * insert into
2957
+ * countries (id, name)
2958
+ * values
2959
+ * (1, 'Mordor');
2960
+ * ```
2961
+ *
2962
+ * @exampleResponse Delete a single record
2963
+ * ```json
2964
+ * {
2965
+ * "status": 204,
2966
+ * "statusText": "No Content"
2967
+ * }
2968
+ * ```
2969
+ *
2970
+ * @example Delete a record and return it
2971
+ * ```ts
2972
+ * const { data, error } = await supabase
2973
+ * .from('countries')
2974
+ * .delete()
2975
+ * .eq('id', 1)
2976
+ * .select()
2977
+ * ```
2978
+ *
2979
+ * @exampleSql Delete a record and return it
2980
+ * ```sql
2981
+ * create table
2982
+ * countries (id int8 primary key, name text);
2983
+ *
2984
+ * insert into
2985
+ * countries (id, name)
2986
+ * values
2987
+ * (1, 'Mordor');
2988
+ * ```
2989
+ *
2990
+ * @exampleResponse Delete a record and return it
2991
+ * ```json
2992
+ * {
2993
+ * "data": [
2994
+ * {
2995
+ * "id": 1,
2996
+ * "name": "Mordor"
2997
+ * }
2998
+ * ],
2999
+ * "status": 200,
3000
+ * "statusText": "OK"
3001
+ * }
3002
+ * ```
3003
+ *
3004
+ * @example Delete multiple records
3005
+ * ```ts
3006
+ * const response = await supabase
3007
+ * .from('countries')
3008
+ * .delete()
3009
+ * .in('id', [1, 2, 3])
3010
+ * ```
3011
+ *
3012
+ * @exampleSql Delete multiple records
3013
+ * ```sql
3014
+ * create table
3015
+ * countries (id int8 primary key, name text);
3016
+ *
3017
+ * insert into
3018
+ * countries (id, name)
3019
+ * values
3020
+ * (1, 'Rohan'), (2, 'The Shire'), (3, 'Mordor');
3021
+ * ```
3022
+ *
3023
+ * @exampleResponse Delete multiple records
3024
+ * ```json
3025
+ * {
3026
+ * "status": 204,
3027
+ * "statusText": "No Content"
3028
+ * }
3029
+ * ```
2150
3030
  */
2151
3031
  delete({
2152
3032
  count
@@ -2225,7 +3105,34 @@ declare class PostgrestClient<Database = any, ClientOptions extends ClientServer
2225
3105
  * @param options.urlLengthLimit - Maximum URL length in characters before warnings/errors are triggered. Defaults to 8000.
2226
3106
  * @example
2227
3107
  * ```ts
2228
- * import PostgrestClient from '@supabase/postgrest-js'
3108
+ * import { PostgrestClient } from '@supabase/postgrest-js'
3109
+ *
3110
+ * const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
3111
+ * headers: { apikey: 'public-anon-key' },
3112
+ * schema: 'public',
3113
+ * timeout: 30000, // 30 second timeout
3114
+ * })
3115
+ * ```
3116
+ *
3117
+ * @category Database
3118
+ *
3119
+ * @remarks
3120
+ * - A `timeout` option (in milliseconds) can be set to automatically abort requests that take too long.
3121
+ * - A `urlLengthLimit` option (default: 8000) can be set to control when URL length warnings are included in error messages for aborted requests.
3122
+ *
3123
+ * @example Creating a Postgrest client
3124
+ * ```ts
3125
+ * import { PostgrestClient } from '@supabase/postgrest-js'
3126
+ *
3127
+ * const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
3128
+ * headers: { apikey: 'public-anon-key' },
3129
+ * schema: 'public',
3130
+ * })
3131
+ * ```
3132
+ *
3133
+ * @example With timeout
3134
+ * ```ts
3135
+ * import { PostgrestClient } from '@supabase/postgrest-js'
2229
3136
  *
2230
3137
  * const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
2231
3138
  * headers: { apikey: 'public-anon-key' },
@@ -2255,6 +3162,8 @@ declare class PostgrestClient<Database = any, ClientOptions extends ClientServer
2255
3162
  * The schema needs to be on the list of exposed schemas inside Supabase.
2256
3163
  *
2257
3164
  * @param schema - The schema to query
3165
+ *
3166
+ * @category Database
2258
3167
  */
2259
3168
  schema<DynamicSchema extends string & keyof Omit<Database, '__InternalSupabase'>>(schema: DynamicSchema): PostgrestClient<Database, ClientOptions, DynamicSchema, Database[DynamicSchema] extends GenericSchema ? Database[DynamicSchema] : any>;
2260
3169
  /**
@@ -2288,6 +3197,139 @@ declare class PostgrestClient<Database = any, ClientOptions extends ClientServer
2288
3197
  * .rpc('function_a', {})
2289
3198
  * .overrideTypes<{ id: string; user_id: string }[]>()
2290
3199
  * ```
3200
+ *
3201
+ * @category Database
3202
+ *
3203
+ * @example Call a Postgres function without arguments
3204
+ * ```ts
3205
+ * const { data, error } = await supabase.rpc('hello_world')
3206
+ * ```
3207
+ *
3208
+ * @exampleSql Call a Postgres function without arguments
3209
+ * ```sql
3210
+ * create function hello_world() returns text as $$
3211
+ * select 'Hello world';
3212
+ * $$ language sql;
3213
+ * ```
3214
+ *
3215
+ * @exampleResponse Call a Postgres function without arguments
3216
+ * ```json
3217
+ * {
3218
+ * "data": "Hello world",
3219
+ * "status": 200,
3220
+ * "statusText": "OK"
3221
+ * }
3222
+ * ```
3223
+ *
3224
+ * @example Call a Postgres function with arguments
3225
+ * ```ts
3226
+ * const { data, error } = await supabase.rpc('echo', { say: '👋' })
3227
+ * ```
3228
+ *
3229
+ * @exampleSql Call a Postgres function with arguments
3230
+ * ```sql
3231
+ * create function echo(say text) returns text as $$
3232
+ * select say;
3233
+ * $$ language sql;
3234
+ * ```
3235
+ *
3236
+ * @exampleResponse Call a Postgres function with arguments
3237
+ * ```json
3238
+ * {
3239
+ * "data": "👋",
3240
+ * "status": 200,
3241
+ * "statusText": "OK"
3242
+ * }
3243
+ *
3244
+ * ```
3245
+ *
3246
+ * @exampleDescription Bulk processing
3247
+ * You can process large payloads by passing in an array as an argument.
3248
+ *
3249
+ * @example Bulk processing
3250
+ * ```ts
3251
+ * const { data, error } = await supabase.rpc('add_one_each', { arr: [1, 2, 3] })
3252
+ * ```
3253
+ *
3254
+ * @exampleSql Bulk processing
3255
+ * ```sql
3256
+ * create function add_one_each(arr int[]) returns int[] as $$
3257
+ * select array_agg(n + 1) from unnest(arr) as n;
3258
+ * $$ language sql;
3259
+ * ```
3260
+ *
3261
+ * @exampleResponse Bulk processing
3262
+ * ```json
3263
+ * {
3264
+ * "data": [
3265
+ * 2,
3266
+ * 3,
3267
+ * 4
3268
+ * ],
3269
+ * "status": 200,
3270
+ * "statusText": "OK"
3271
+ * }
3272
+ * ```
3273
+ *
3274
+ * @exampleDescription Call a Postgres function with filters
3275
+ * Postgres functions that return tables can also be combined with [Filters](/docs/reference/javascript/using-filters) and [Modifiers](/docs/reference/javascript/using-modifiers).
3276
+ *
3277
+ * @example Call a Postgres function with filters
3278
+ * ```ts
3279
+ * const { data, error } = await supabase
3280
+ * .rpc('list_stored_countries')
3281
+ * .eq('id', 1)
3282
+ * .single()
3283
+ * ```
3284
+ *
3285
+ * @exampleSql Call a Postgres function with filters
3286
+ * ```sql
3287
+ * create table
3288
+ * countries (id int8 primary key, name text);
3289
+ *
3290
+ * insert into
3291
+ * countries (id, name)
3292
+ * values
3293
+ * (1, 'Rohan'),
3294
+ * (2, 'The Shire');
3295
+ *
3296
+ * create function list_stored_countries() returns setof countries as $$
3297
+ * select * from countries;
3298
+ * $$ language sql;
3299
+ * ```
3300
+ *
3301
+ * @exampleResponse Call a Postgres function with filters
3302
+ * ```json
3303
+ * {
3304
+ * "data": {
3305
+ * "id": 1,
3306
+ * "name": "Rohan"
3307
+ * },
3308
+ * "status": 200,
3309
+ * "statusText": "OK"
3310
+ * }
3311
+ * ```
3312
+ *
3313
+ * @example Call a read-only Postgres function
3314
+ * ```ts
3315
+ * const { data, error } = await supabase.rpc('hello_world', undefined, { get: true })
3316
+ * ```
3317
+ *
3318
+ * @exampleSql Call a read-only Postgres function
3319
+ * ```sql
3320
+ * create function hello_world() returns text as $$
3321
+ * select 'Hello world';
3322
+ * $$ language sql;
3323
+ * ```
3324
+ *
3325
+ * @exampleResponse Call a read-only Postgres function
3326
+ * ```json
3327
+ * {
3328
+ * "data": "Hello world",
3329
+ * "status": 200,
3330
+ * "statusText": "OK"
3331
+ * }
3332
+ * ```
2291
3333
  */
2292
3334
  rpc<FnName extends string & keyof Schema['Functions'], Args extends Schema['Functions'][FnName]['Args'] = never, FilterBuilder extends GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args> = GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args>>(fn: FnName, args?: Args, {
2293
3335
  head,