@supabase/postgrest-js 2.108.2 → 2.108.3-canary.0
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.cjs +96 -1376
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1427 -112
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1427 -112
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +96 -1376
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PostgrestClient.ts +13 -19
- package/src/PostgrestFilterBuilder.ts +100 -84
- package/src/PostgrestTransformBuilder.ts +19 -0
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/PostgrestClient.ts
CHANGED
|
@@ -20,13 +20,10 @@ export default class PostgrestClient<
|
|
|
20
20
|
}
|
|
21
21
|
? I
|
|
22
22
|
: {},
|
|
23
|
-
SchemaName extends string &
|
|
24
|
-
keyof Omit<Database, '__InternalSupabase'>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
>
|
|
28
|
-
? 'public'
|
|
29
|
-
: string & keyof Omit<Database, '__InternalSupabase'>,
|
|
23
|
+
SchemaName extends string & keyof Omit<Database, '__InternalSupabase'> =
|
|
24
|
+
'public' extends keyof Omit<Database, '__InternalSupabase'>
|
|
25
|
+
? 'public'
|
|
26
|
+
: string & keyof Omit<Database, '__InternalSupabase'>,
|
|
30
27
|
Schema extends GenericSchema = Omit<
|
|
31
28
|
Database,
|
|
32
29
|
'__InternalSupabase'
|
|
@@ -149,13 +146,6 @@ export default class PostgrestClient<
|
|
|
149
146
|
}
|
|
150
147
|
this.retry = retry
|
|
151
148
|
}
|
|
152
|
-
from<
|
|
153
|
-
TableName extends string & keyof Schema['Tables'],
|
|
154
|
-
Table extends Schema['Tables'][TableName],
|
|
155
|
-
>(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>
|
|
156
|
-
from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(
|
|
157
|
-
relation: ViewName
|
|
158
|
-
): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>
|
|
159
149
|
/**
|
|
160
150
|
* Perform a query on a table or a view.
|
|
161
151
|
*
|
|
@@ -163,6 +153,13 @@ export default class PostgrestClient<
|
|
|
163
153
|
*
|
|
164
154
|
* @category Database
|
|
165
155
|
*/
|
|
156
|
+
from<
|
|
157
|
+
TableName extends string & keyof Schema['Tables'],
|
|
158
|
+
Table extends Schema['Tables'][TableName],
|
|
159
|
+
>(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>
|
|
160
|
+
from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(
|
|
161
|
+
relation: ViewName
|
|
162
|
+
): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>
|
|
166
163
|
from(
|
|
167
164
|
relation: (string & keyof Schema['Tables']) | (string & keyof Schema['Views'])
|
|
168
165
|
): PostgrestQueryBuilder<ClientOptions, Schema, any, any> {
|
|
@@ -374,11 +371,8 @@ export default class PostgrestClient<
|
|
|
374
371
|
rpc<
|
|
375
372
|
FnName extends string & keyof Schema['Functions'],
|
|
376
373
|
Args extends Schema['Functions'][FnName]['Args'] = never,
|
|
377
|
-
FilterBuilder extends GetRpcFunctionFilterBuilderByArgs<
|
|
378
|
-
Schema,
|
|
379
|
-
FnName,
|
|
380
|
-
Args
|
|
381
|
-
> = GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args>,
|
|
374
|
+
FilterBuilder extends GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args> =
|
|
375
|
+
GetRpcFunctionFilterBuilderByArgs<Schema, FnName, Args>,
|
|
382
376
|
>(
|
|
383
377
|
fn: FnName,
|
|
384
378
|
args: Args = {} as Args,
|
|
@@ -266,8 +266,6 @@ export default class PostgrestFilterBuilder<
|
|
|
266
266
|
return this
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
gt<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
270
|
-
gt(column: string, value: unknown): this
|
|
271
269
|
/**
|
|
272
270
|
* Match only rows where `column` is greater than `value`.
|
|
273
271
|
*
|
|
@@ -316,13 +314,13 @@ export default class PostgrestFilterBuilder<
|
|
|
316
314
|
* }
|
|
317
315
|
* ```
|
|
318
316
|
*/
|
|
317
|
+
gt<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
318
|
+
gt(column: string, value: unknown): this
|
|
319
319
|
gt(column: string, value: unknown): this {
|
|
320
320
|
this.url.searchParams.append(column, `gt.${value}`)
|
|
321
321
|
return this
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
gte<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
325
|
-
gte(column: string, value: unknown): this
|
|
326
324
|
/**
|
|
327
325
|
* Match only rows where `column` is greater than or equal to `value`.
|
|
328
326
|
*
|
|
@@ -371,13 +369,13 @@ export default class PostgrestFilterBuilder<
|
|
|
371
369
|
* }
|
|
372
370
|
* ```
|
|
373
371
|
*/
|
|
372
|
+
gte<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
373
|
+
gte(column: string, value: unknown): this
|
|
374
374
|
gte(column: string, value: unknown): this {
|
|
375
375
|
this.url.searchParams.append(column, `gte.${value}`)
|
|
376
376
|
return this
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
lt<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
380
|
-
lt(column: string, value: unknown): this
|
|
381
379
|
/**
|
|
382
380
|
* Match only rows where `column` is less than `value`.
|
|
383
381
|
*
|
|
@@ -422,13 +420,13 @@ export default class PostgrestFilterBuilder<
|
|
|
422
420
|
* }
|
|
423
421
|
* ```
|
|
424
422
|
*/
|
|
423
|
+
lt<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
424
|
+
lt(column: string, value: unknown): this
|
|
425
425
|
lt(column: string, value: unknown): this {
|
|
426
426
|
this.url.searchParams.append(column, `lt.${value}`)
|
|
427
427
|
return this
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
lte<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
431
|
-
lte(column: string, value: unknown): this
|
|
432
430
|
/**
|
|
433
431
|
* Match only rows where `column` is less than or equal to `value`.
|
|
434
432
|
*
|
|
@@ -477,13 +475,13 @@ export default class PostgrestFilterBuilder<
|
|
|
477
475
|
* }
|
|
478
476
|
* ```
|
|
479
477
|
*/
|
|
478
|
+
lte<ColumnName extends string & keyof Row>(column: ColumnName, value: Row[ColumnName]): this
|
|
479
|
+
lte(column: string, value: unknown): this
|
|
480
480
|
lte(column: string, value: unknown): this {
|
|
481
481
|
this.url.searchParams.append(column, `lte.${value}`)
|
|
482
482
|
return this
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
like<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
486
|
-
like(column: string, pattern: string): this
|
|
487
485
|
/**
|
|
488
486
|
* Match only rows where `column` matches `pattern` case-sensitively.
|
|
489
487
|
*
|
|
@@ -528,16 +526,13 @@ export default class PostgrestFilterBuilder<
|
|
|
528
526
|
* }
|
|
529
527
|
* ```
|
|
530
528
|
*/
|
|
529
|
+
like<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
530
|
+
like(column: string, pattern: string): this
|
|
531
531
|
like(column: string, pattern: string): this {
|
|
532
532
|
this.url.searchParams.append(column, `like.${pattern}`)
|
|
533
533
|
return this
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
-
likeAllOf<ColumnName extends string & keyof Row>(
|
|
537
|
-
column: ColumnName,
|
|
538
|
-
patterns: readonly string[]
|
|
539
|
-
): this
|
|
540
|
-
likeAllOf(column: string, patterns: readonly string[]): this
|
|
541
536
|
/**
|
|
542
537
|
* Match only rows where `column` matches all of `patterns` case-sensitively.
|
|
543
538
|
*
|
|
@@ -547,16 +542,16 @@ export default class PostgrestFilterBuilder<
|
|
|
547
542
|
* @category Database
|
|
548
543
|
* @subcategory Using filters
|
|
549
544
|
*/
|
|
545
|
+
likeAllOf<ColumnName extends string & keyof Row>(
|
|
546
|
+
column: ColumnName,
|
|
547
|
+
patterns: readonly string[]
|
|
548
|
+
): this
|
|
549
|
+
likeAllOf(column: string, patterns: readonly string[]): this
|
|
550
550
|
likeAllOf(column: string, patterns: readonly string[]): this {
|
|
551
551
|
this.url.searchParams.append(column, `like(all).{${patterns.join(',')}}`)
|
|
552
552
|
return this
|
|
553
553
|
}
|
|
554
554
|
|
|
555
|
-
likeAnyOf<ColumnName extends string & keyof Row>(
|
|
556
|
-
column: ColumnName,
|
|
557
|
-
patterns: readonly string[]
|
|
558
|
-
): this
|
|
559
|
-
likeAnyOf(column: string, patterns: readonly string[]): this
|
|
560
555
|
/**
|
|
561
556
|
* Match only rows where `column` matches any of `patterns` case-sensitively.
|
|
562
557
|
*
|
|
@@ -566,13 +561,16 @@ export default class PostgrestFilterBuilder<
|
|
|
566
561
|
* @category Database
|
|
567
562
|
* @subcategory Using filters
|
|
568
563
|
*/
|
|
564
|
+
likeAnyOf<ColumnName extends string & keyof Row>(
|
|
565
|
+
column: ColumnName,
|
|
566
|
+
patterns: readonly string[]
|
|
567
|
+
): this
|
|
568
|
+
likeAnyOf(column: string, patterns: readonly string[]): this
|
|
569
569
|
likeAnyOf(column: string, patterns: readonly string[]): this {
|
|
570
570
|
this.url.searchParams.append(column, `like(any).{${patterns.join(',')}}`)
|
|
571
571
|
return this
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
-
ilike<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
575
|
-
ilike(column: string, pattern: string): this
|
|
576
574
|
/**
|
|
577
575
|
* Match only rows where `column` matches `pattern` case-insensitively.
|
|
578
576
|
*
|
|
@@ -617,16 +615,13 @@ export default class PostgrestFilterBuilder<
|
|
|
617
615
|
* }
|
|
618
616
|
* ```
|
|
619
617
|
*/
|
|
618
|
+
ilike<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
619
|
+
ilike(column: string, pattern: string): this
|
|
620
620
|
ilike(column: string, pattern: string): this {
|
|
621
621
|
this.url.searchParams.append(column, `ilike.${pattern}`)
|
|
622
622
|
return this
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
ilikeAllOf<ColumnName extends string & keyof Row>(
|
|
626
|
-
column: ColumnName,
|
|
627
|
-
patterns: readonly string[]
|
|
628
|
-
): this
|
|
629
|
-
ilikeAllOf(column: string, patterns: readonly string[]): this
|
|
630
625
|
/**
|
|
631
626
|
* Match only rows where `column` matches all of `patterns` case-insensitively.
|
|
632
627
|
*
|
|
@@ -636,16 +631,16 @@ export default class PostgrestFilterBuilder<
|
|
|
636
631
|
* @category Database
|
|
637
632
|
* @subcategory Using filters
|
|
638
633
|
*/
|
|
634
|
+
ilikeAllOf<ColumnName extends string & keyof Row>(
|
|
635
|
+
column: ColumnName,
|
|
636
|
+
patterns: readonly string[]
|
|
637
|
+
): this
|
|
638
|
+
ilikeAllOf(column: string, patterns: readonly string[]): this
|
|
639
639
|
ilikeAllOf(column: string, patterns: readonly string[]): this {
|
|
640
640
|
this.url.searchParams.append(column, `ilike(all).{${patterns.join(',')}}`)
|
|
641
641
|
return this
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
ilikeAnyOf<ColumnName extends string & keyof Row>(
|
|
645
|
-
column: ColumnName,
|
|
646
|
-
patterns: readonly string[]
|
|
647
|
-
): this
|
|
648
|
-
ilikeAnyOf(column: string, patterns: readonly string[]): this
|
|
649
644
|
/**
|
|
650
645
|
* Match only rows where `column` matches any of `patterns` case-insensitively.
|
|
651
646
|
*
|
|
@@ -655,13 +650,16 @@ export default class PostgrestFilterBuilder<
|
|
|
655
650
|
* @category Database
|
|
656
651
|
* @subcategory Using filters
|
|
657
652
|
*/
|
|
653
|
+
ilikeAnyOf<ColumnName extends string & keyof Row>(
|
|
654
|
+
column: ColumnName,
|
|
655
|
+
patterns: readonly string[]
|
|
656
|
+
): this
|
|
657
|
+
ilikeAnyOf(column: string, patterns: readonly string[]): this
|
|
658
658
|
ilikeAnyOf(column: string, patterns: readonly string[]): this {
|
|
659
659
|
this.url.searchParams.append(column, `ilike(any).{${patterns.join(',')}}`)
|
|
660
660
|
return this
|
|
661
661
|
}
|
|
662
662
|
|
|
663
|
-
regexMatch<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
664
|
-
regexMatch(column: string, pattern: string): this
|
|
665
663
|
/**
|
|
666
664
|
* Match only rows where `column` matches the PostgreSQL regex `pattern`
|
|
667
665
|
* case-sensitively (using the `~` operator).
|
|
@@ -669,13 +667,13 @@ export default class PostgrestFilterBuilder<
|
|
|
669
667
|
* @param column - The column to filter on
|
|
670
668
|
* @param pattern - The PostgreSQL regular expression pattern to match with
|
|
671
669
|
*/
|
|
670
|
+
regexMatch<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
671
|
+
regexMatch(column: string, pattern: string): this
|
|
672
672
|
regexMatch(column: string, pattern: string): this {
|
|
673
673
|
this.url.searchParams.append(column, `match.${pattern}`)
|
|
674
674
|
return this
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
regexIMatch<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
678
|
-
regexIMatch(column: string, pattern: string): this
|
|
679
677
|
/**
|
|
680
678
|
* Match only rows where `column` matches the PostgreSQL regex `pattern`
|
|
681
679
|
* case-insensitively (using the `~*` operator).
|
|
@@ -683,16 +681,13 @@ export default class PostgrestFilterBuilder<
|
|
|
683
681
|
* @param column - The column to filter on
|
|
684
682
|
* @param pattern - The PostgreSQL regular expression pattern to match with
|
|
685
683
|
*/
|
|
684
|
+
regexIMatch<ColumnName extends string & keyof Row>(column: ColumnName, pattern: string): this
|
|
685
|
+
regexIMatch(column: string, pattern: string): this
|
|
686
686
|
regexIMatch(column: string, pattern: string): this {
|
|
687
687
|
this.url.searchParams.append(column, `imatch.${pattern}`)
|
|
688
688
|
return this
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
-
is<ColumnName extends string & keyof Row>(
|
|
692
|
-
column: ColumnName,
|
|
693
|
-
value: Row[ColumnName] & (boolean | null)
|
|
694
|
-
): this
|
|
695
|
-
is(column: string, value: boolean | null): this
|
|
696
691
|
/**
|
|
697
692
|
* Match only rows where `column` IS `value`.
|
|
698
693
|
*
|
|
@@ -747,6 +742,11 @@ export default class PostgrestFilterBuilder<
|
|
|
747
742
|
* }
|
|
748
743
|
* ```
|
|
749
744
|
*/
|
|
745
|
+
is<ColumnName extends string & keyof Row>(
|
|
746
|
+
column: ColumnName,
|
|
747
|
+
value: Row[ColumnName] & (boolean | null)
|
|
748
|
+
): this
|
|
749
|
+
is(column: string, value: boolean | null): this
|
|
750
750
|
is(column: string, value: boolean | null): this {
|
|
751
751
|
this.url.searchParams.append(column, `is.${value}`)
|
|
752
752
|
return this
|
|
@@ -875,11 +875,6 @@ export default class PostgrestFilterBuilder<
|
|
|
875
875
|
return this
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
-
contains<ColumnName extends string & keyof Row>(
|
|
879
|
-
column: ColumnName,
|
|
880
|
-
value: string | ReadonlyArray<Row[ColumnName]> | Record<string, unknown>
|
|
881
|
-
): this
|
|
882
|
-
contains(column: string, value: string | readonly unknown[] | Record<string, unknown>): this
|
|
883
878
|
/**
|
|
884
879
|
* Only relevant for jsonb, array, and range columns. Match only rows where
|
|
885
880
|
* `column` contains every element appearing in `value`.
|
|
@@ -1009,6 +1004,11 @@ export default class PostgrestFilterBuilder<
|
|
|
1009
1004
|
* }
|
|
1010
1005
|
* ```
|
|
1011
1006
|
*/
|
|
1007
|
+
contains<ColumnName extends string & keyof Row>(
|
|
1008
|
+
column: ColumnName,
|
|
1009
|
+
value: string | ReadonlyArray<Row[ColumnName]> | Record<string, unknown>
|
|
1010
|
+
): this
|
|
1011
|
+
contains(column: string, value: string | readonly unknown[] | Record<string, unknown>): this
|
|
1012
1012
|
contains(column: string, value: string | readonly unknown[] | Record<string, unknown>): this {
|
|
1013
1013
|
if (typeof value === 'string') {
|
|
1014
1014
|
// range types can be inclusive '[', ']' or exclusive '(', ')' so just
|
|
@@ -1024,11 +1024,6 @@ export default class PostgrestFilterBuilder<
|
|
|
1024
1024
|
return this
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
-
containedBy<ColumnName extends string & keyof Row>(
|
|
1028
|
-
column: ColumnName,
|
|
1029
|
-
value: string | ReadonlyArray<Row[ColumnName]> | Record<string, unknown>
|
|
1030
|
-
): this
|
|
1031
|
-
containedBy(column: string, value: string | readonly unknown[] | Record<string, unknown>): this
|
|
1032
1027
|
/**
|
|
1033
1028
|
* Only relevant for jsonb, array, and range columns. Match only rows where
|
|
1034
1029
|
* every element appearing in `column` is contained by `value`.
|
|
@@ -1159,6 +1154,11 @@ export default class PostgrestFilterBuilder<
|
|
|
1159
1154
|
*
|
|
1160
1155
|
* ```
|
|
1161
1156
|
*/
|
|
1157
|
+
containedBy<ColumnName extends string & keyof Row>(
|
|
1158
|
+
column: ColumnName,
|
|
1159
|
+
value: string | ReadonlyArray<Row[ColumnName]> | Record<string, unknown>
|
|
1160
|
+
): this
|
|
1161
|
+
containedBy(column: string, value: string | readonly unknown[] | Record<string, unknown>): this
|
|
1162
1162
|
containedBy(column: string, value: string | readonly unknown[] | Record<string, unknown>): this {
|
|
1163
1163
|
if (typeof value === 'string') {
|
|
1164
1164
|
// range
|
|
@@ -1173,8 +1173,6 @@ export default class PostgrestFilterBuilder<
|
|
|
1173
1173
|
return this
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
-
rangeGt<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1177
|
-
rangeGt(column: string, range: string): this
|
|
1178
1176
|
/**
|
|
1179
1177
|
* Only relevant for range columns. Match only rows where every element in
|
|
1180
1178
|
* `column` is greater than any element in `range`.
|
|
@@ -1231,13 +1229,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1231
1229
|
*
|
|
1232
1230
|
* ```
|
|
1233
1231
|
*/
|
|
1232
|
+
rangeGt<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1233
|
+
rangeGt(column: string, range: string): this
|
|
1234
1234
|
rangeGt(column: string, range: string): this {
|
|
1235
1235
|
this.url.searchParams.append(column, `sr.${range}`)
|
|
1236
1236
|
return this
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
|
-
rangeGte<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1240
|
-
rangeGte(column: string, range: string): this
|
|
1241
1239
|
/**
|
|
1242
1240
|
* Only relevant for range columns. Match only rows where every element in
|
|
1243
1241
|
* `column` is either contained in `range` or greater than any element in
|
|
@@ -1295,13 +1293,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1295
1293
|
*
|
|
1296
1294
|
* ```
|
|
1297
1295
|
*/
|
|
1296
|
+
rangeGte<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1297
|
+
rangeGte(column: string, range: string): this
|
|
1298
1298
|
rangeGte(column: string, range: string): this {
|
|
1299
1299
|
this.url.searchParams.append(column, `nxl.${range}`)
|
|
1300
1300
|
return this
|
|
1301
1301
|
}
|
|
1302
1302
|
|
|
1303
|
-
rangeLt<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1304
|
-
rangeLt(column: string, range: string): this
|
|
1305
1303
|
/**
|
|
1306
1304
|
* Only relevant for range columns. Match only rows where every element in
|
|
1307
1305
|
* `column` is less than any element in `range`.
|
|
@@ -1357,13 +1355,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1357
1355
|
* }
|
|
1358
1356
|
* ```
|
|
1359
1357
|
*/
|
|
1358
|
+
rangeLt<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1359
|
+
rangeLt(column: string, range: string): this
|
|
1360
1360
|
rangeLt(column: string, range: string): this {
|
|
1361
1361
|
this.url.searchParams.append(column, `sl.${range}`)
|
|
1362
1362
|
return this
|
|
1363
1363
|
}
|
|
1364
1364
|
|
|
1365
|
-
rangeLte<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1366
|
-
rangeLte(column: string, range: string): this
|
|
1367
1365
|
/**
|
|
1368
1366
|
* Only relevant for range columns. Match only rows where every element in
|
|
1369
1367
|
* `column` is either contained in `range` or less than any element in
|
|
@@ -1421,13 +1419,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1421
1419
|
*
|
|
1422
1420
|
* ```
|
|
1423
1421
|
*/
|
|
1422
|
+
rangeLte<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1423
|
+
rangeLte(column: string, range: string): this
|
|
1424
1424
|
rangeLte(column: string, range: string): this {
|
|
1425
1425
|
this.url.searchParams.append(column, `nxr.${range}`)
|
|
1426
1426
|
return this
|
|
1427
1427
|
}
|
|
1428
1428
|
|
|
1429
|
-
rangeAdjacent<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1430
|
-
rangeAdjacent(column: string, range: string): this
|
|
1431
1429
|
/**
|
|
1432
1430
|
* Only relevant for range columns. Match only rows where `column` is
|
|
1433
1431
|
* mutually exclusive to `range` and there can be no element between the two
|
|
@@ -1484,16 +1482,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1484
1482
|
* }
|
|
1485
1483
|
* ```
|
|
1486
1484
|
*/
|
|
1485
|
+
rangeAdjacent<ColumnName extends string & keyof Row>(column: ColumnName, range: string): this
|
|
1486
|
+
rangeAdjacent(column: string, range: string): this
|
|
1487
1487
|
rangeAdjacent(column: string, range: string): this {
|
|
1488
1488
|
this.url.searchParams.append(column, `adj.${range}`)
|
|
1489
1489
|
return this
|
|
1490
1490
|
}
|
|
1491
1491
|
|
|
1492
|
-
overlaps<ColumnName extends string & keyof Row>(
|
|
1493
|
-
column: ColumnName,
|
|
1494
|
-
value: string | ReadonlyArray<Row[ColumnName]>
|
|
1495
|
-
): this
|
|
1496
|
-
overlaps(column: string, value: string | readonly unknown[]): this
|
|
1497
1492
|
/**
|
|
1498
1493
|
* Only relevant for array and range columns. Match only rows where
|
|
1499
1494
|
* `column` and `value` have an element in common.
|
|
@@ -1586,6 +1581,11 @@ export default class PostgrestFilterBuilder<
|
|
|
1586
1581
|
* }
|
|
1587
1582
|
* ```
|
|
1588
1583
|
*/
|
|
1584
|
+
overlaps<ColumnName extends string & keyof Row>(
|
|
1585
|
+
column: ColumnName,
|
|
1586
|
+
value: string | ReadonlyArray<Row[ColumnName]>
|
|
1587
|
+
): this
|
|
1588
|
+
overlaps(column: string, value: string | readonly unknown[]): this
|
|
1589
1589
|
overlaps(column: string, value: string | readonly unknown[]): this {
|
|
1590
1590
|
if (typeof value === 'string') {
|
|
1591
1591
|
// range
|
|
@@ -1597,16 +1597,6 @@ export default class PostgrestFilterBuilder<
|
|
|
1597
1597
|
return this
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
|
-
textSearch<ColumnName extends string & keyof Row>(
|
|
1601
|
-
column: ColumnName,
|
|
1602
|
-
query: string,
|
|
1603
|
-
options?: { config?: string; type?: 'plain' | 'phrase' | 'websearch' }
|
|
1604
|
-
): this
|
|
1605
|
-
textSearch(
|
|
1606
|
-
column: string,
|
|
1607
|
-
query: string,
|
|
1608
|
-
options?: { config?: string; type?: 'plain' | 'phrase' | 'websearch' }
|
|
1609
|
-
): this
|
|
1610
1600
|
/**
|
|
1611
1601
|
* Only relevant for text and tsvector columns. Match only rows where
|
|
1612
1602
|
* `column` matches the query string in `query`.
|
|
@@ -1711,6 +1701,16 @@ export default class PostgrestFilterBuilder<
|
|
|
1711
1701
|
* })
|
|
1712
1702
|
* ```
|
|
1713
1703
|
*/
|
|
1704
|
+
textSearch<ColumnName extends string & keyof Row>(
|
|
1705
|
+
column: ColumnName,
|
|
1706
|
+
query: string,
|
|
1707
|
+
options?: { config?: string; type?: 'plain' | 'phrase' | 'websearch' }
|
|
1708
|
+
): this
|
|
1709
|
+
textSearch(
|
|
1710
|
+
column: string,
|
|
1711
|
+
query: string,
|
|
1712
|
+
options?: { config?: string; type?: 'plain' | 'phrase' | 'websearch' }
|
|
1713
|
+
): this
|
|
1714
1714
|
textSearch(
|
|
1715
1715
|
column: string,
|
|
1716
1716
|
query: string,
|
|
@@ -1729,8 +1729,6 @@ export default class PostgrestFilterBuilder<
|
|
|
1729
1729
|
return this
|
|
1730
1730
|
}
|
|
1731
1731
|
|
|
1732
|
-
match<ColumnName extends string & keyof Row>(query: Record<ColumnName, Row[ColumnName]>): this
|
|
1733
|
-
match(query: Record<string, unknown>): this
|
|
1734
1732
|
/**
|
|
1735
1733
|
* Match only rows where each column in `query` keys is equal to its
|
|
1736
1734
|
* associated value. Shorthand for multiple `.eq()`s.
|
|
@@ -1775,6 +1773,8 @@ export default class PostgrestFilterBuilder<
|
|
|
1775
1773
|
* }
|
|
1776
1774
|
* ```
|
|
1777
1775
|
*/
|
|
1776
|
+
match<ColumnName extends string & keyof Row>(query: Record<ColumnName, Row[ColumnName]>): this
|
|
1777
|
+
match(query: Record<string, unknown>): this
|
|
1778
1778
|
match(query: Record<string, unknown>): this {
|
|
1779
1779
|
Object.entries(query)
|
|
1780
1780
|
// columns with `undefined` value needs to be filtered out, otherwise it'll
|
|
@@ -1786,6 +1786,22 @@ export default class PostgrestFilterBuilder<
|
|
|
1786
1786
|
return this
|
|
1787
1787
|
}
|
|
1788
1788
|
|
|
1789
|
+
/**
|
|
1790
|
+
* Match only rows which doesn't satisfy the filter.
|
|
1791
|
+
*
|
|
1792
|
+
* Unlike most filters, `opearator` and `value` are used as-is and need to
|
|
1793
|
+
* follow [PostgREST
|
|
1794
|
+
* syntax](https://postgrest.org/en/stable/api.html#operators). You also need
|
|
1795
|
+
* to make sure they are properly sanitized.
|
|
1796
|
+
*
|
|
1797
|
+
* @param column - The column to filter on
|
|
1798
|
+
* @param operator - The operator to be negated to filter with, following
|
|
1799
|
+
* PostgREST syntax
|
|
1800
|
+
* @param value - The value to filter with, following PostgREST syntax
|
|
1801
|
+
*
|
|
1802
|
+
* @category Database
|
|
1803
|
+
* @subcategory Using filters
|
|
1804
|
+
*/
|
|
1789
1805
|
not<ColumnName extends string & keyof Row>(
|
|
1790
1806
|
column: ColumnName,
|
|
1791
1807
|
operator: 'is',
|
|
@@ -2048,12 +2064,6 @@ export default class PostgrestFilterBuilder<
|
|
|
2048
2064
|
return this
|
|
2049
2065
|
}
|
|
2050
2066
|
|
|
2051
|
-
filter<ColumnName extends string & keyof Row>(
|
|
2052
|
-
column: ColumnName,
|
|
2053
|
-
operator: `${'' | 'not.'}${FilterOperator}`,
|
|
2054
|
-
value: unknown
|
|
2055
|
-
): this
|
|
2056
|
-
filter(column: string, operator: string, value: unknown): this
|
|
2057
2067
|
/**
|
|
2058
2068
|
* Match only rows which satisfy the filter. This is an escape hatch - you
|
|
2059
2069
|
* should use the specific filter methods wherever possible.
|
|
@@ -2167,6 +2177,12 @@ export default class PostgrestFilterBuilder<
|
|
|
2167
2177
|
* }
|
|
2168
2178
|
* ```
|
|
2169
2179
|
*/
|
|
2180
|
+
filter<ColumnName extends string & keyof Row>(
|
|
2181
|
+
column: ColumnName,
|
|
2182
|
+
operator: `${'' | 'not.'}${FilterOperator}`,
|
|
2183
|
+
value: unknown
|
|
2184
|
+
): this
|
|
2185
|
+
filter(column: string, operator: string, value: unknown): this
|
|
2170
2186
|
filter(column: string, operator: string, value: unknown): this {
|
|
2171
2187
|
this.url.searchParams.append(column, `${operator}.${value}`)
|
|
2172
2188
|
return this
|
|
@@ -133,6 +133,25 @@ export default class PostgrestTransformBuilder<
|
|
|
133
133
|
>
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Order the query result by `column`.
|
|
138
|
+
*
|
|
139
|
+
* You can call this method multiple times to order by multiple columns.
|
|
140
|
+
*
|
|
141
|
+
* You can order referenced tables, but it only affects the ordering of the
|
|
142
|
+
* parent table if you use `!inner` in the query.
|
|
143
|
+
*
|
|
144
|
+
* @param column - The column to order by
|
|
145
|
+
* @param options - Named parameters
|
|
146
|
+
* @param options.ascending - If `true`, the result will be in ascending order
|
|
147
|
+
* @param options.nullsFirst - If `true`, `null`s appear first. If `false`,
|
|
148
|
+
* `null`s appear last.
|
|
149
|
+
* @param options.referencedTable - Set this to order a referenced table by
|
|
150
|
+
* its columns
|
|
151
|
+
*
|
|
152
|
+
* @category Database
|
|
153
|
+
* @subcategory Using modifiers
|
|
154
|
+
*/
|
|
136
155
|
order<ColumnName extends string & keyof Row>(
|
|
137
156
|
column: ColumnName,
|
|
138
157
|
options?: { ascending?: boolean; nullsFirst?: boolean; referencedTable?: undefined }
|
package/src/version.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// - Debugging and support (identifying which version is running)
|
|
5
5
|
// - Telemetry and logging (version reporting in errors/analytics)
|
|
6
6
|
// - Ensuring build artifacts match the published package version
|
|
7
|
-
export const version = '2.108.
|
|
7
|
+
export const version = '2.108.3-canary.0'
|