@supabase/postgrest-js 3.0.0-next.0 → 3.0.0-next.10
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PostgrestBuilder.ts +2 -2
- package/src/PostgrestClient.ts +2 -2
- package/src/PostgrestFilterBuilder.ts +35 -2
- package/src/PostgrestQueryBuilder.ts +2 -2
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/PostgrestBuilder.ts
CHANGED
|
@@ -96,7 +96,7 @@ export default abstract class PostgrestBuilder<
|
|
|
96
96
|
* ```ts
|
|
97
97
|
* import { createClient } from '@supabase/supabase-js'
|
|
98
98
|
*
|
|
99
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
99
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
100
100
|
* const { data, error } = await supabase.from('users').select('*')
|
|
101
101
|
* ```
|
|
102
102
|
*
|
|
@@ -108,7 +108,7 @@ export default abstract class PostgrestBuilder<
|
|
|
108
108
|
*
|
|
109
109
|
* const builder = new PostgrestQueryBuilder(
|
|
110
110
|
* new URL('https://xyzcompany.supabase.co/rest/v1/users'),
|
|
111
|
-
* { headers: new Headers({ apikey: 'publishable-
|
|
111
|
+
* { headers: new Headers({ apikey: 'your-publishable-key' }) }
|
|
112
112
|
* )
|
|
113
113
|
* ```
|
|
114
114
|
*/
|
package/src/PostgrestClient.ts
CHANGED
|
@@ -62,7 +62,7 @@ export default class PostgrestClient<
|
|
|
62
62
|
* ```ts
|
|
63
63
|
* import { createClient } from '@supabase/supabase-js'
|
|
64
64
|
*
|
|
65
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
65
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
66
66
|
* const { data, error } = await supabase.from('profiles').select('*')
|
|
67
67
|
* ```
|
|
68
68
|
*
|
|
@@ -77,7 +77,7 @@ export default class PostgrestClient<
|
|
|
77
77
|
* import { PostgrestClient } from '@supabase/postgrest-js'
|
|
78
78
|
*
|
|
79
79
|
* const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
|
|
80
|
-
* headers: { apikey: 'publishable-
|
|
80
|
+
* headers: { apikey: 'your-publishable-key' },
|
|
81
81
|
* schema: 'public',
|
|
82
82
|
* timeout: 30000, // 30 second timeout
|
|
83
83
|
* })
|
|
@@ -76,6 +76,22 @@ type ResolveFilterRelationshipValue<
|
|
|
76
76
|
|
|
77
77
|
export type InvalidMethodError<S extends string> = { Error: S }
|
|
78
78
|
|
|
79
|
+
type NonNullableColumn<T extends Record<string, unknown>, Col extends string> = Col extends keyof T
|
|
80
|
+
? { [K in keyof T]: K extends Col ? NonNullable<T[K]> : T[K] }
|
|
81
|
+
: T
|
|
82
|
+
|
|
83
|
+
type NarrowResultColumn<T, Col extends string> = T extends (infer Item)[]
|
|
84
|
+
? Item extends Record<string, unknown>
|
|
85
|
+
? Col extends keyof Item
|
|
86
|
+
? { [K in keyof Item]: K extends Col ? NonNullable<Item[K]> : Item[K] }[]
|
|
87
|
+
: T
|
|
88
|
+
: T
|
|
89
|
+
: T extends Record<string, unknown>
|
|
90
|
+
? Col extends keyof T
|
|
91
|
+
? { [K in keyof T]: K extends Col ? NonNullable<T[K]> : T[K] }
|
|
92
|
+
: T
|
|
93
|
+
: T
|
|
94
|
+
|
|
79
95
|
export default class PostgrestFilterBuilder<
|
|
80
96
|
ClientOptions extends ClientServerOptions,
|
|
81
97
|
Schema extends GenericSchema,
|
|
@@ -1719,6 +1735,19 @@ export default class PostgrestFilterBuilder<
|
|
|
1719
1735
|
return this
|
|
1720
1736
|
}
|
|
1721
1737
|
|
|
1738
|
+
not<ColumnName extends string & keyof Row>(
|
|
1739
|
+
column: ColumnName,
|
|
1740
|
+
operator: 'is',
|
|
1741
|
+
value: null
|
|
1742
|
+
): PostgrestFilterBuilder<
|
|
1743
|
+
ClientOptions,
|
|
1744
|
+
Schema,
|
|
1745
|
+
NonNullableColumn<Row, ColumnName>,
|
|
1746
|
+
NarrowResultColumn<Result, ColumnName>,
|
|
1747
|
+
RelationName,
|
|
1748
|
+
Relationships,
|
|
1749
|
+
Method
|
|
1750
|
+
>
|
|
1722
1751
|
not<ColumnName extends string & keyof Row>(
|
|
1723
1752
|
column: ColumnName,
|
|
1724
1753
|
operator: FilterOperator,
|
|
@@ -1783,9 +1812,13 @@ export default class PostgrestFilterBuilder<
|
|
|
1783
1812
|
*
|
|
1784
1813
|
* ```
|
|
1785
1814
|
*/
|
|
1786
|
-
not(
|
|
1815
|
+
not(
|
|
1816
|
+
column: string,
|
|
1817
|
+
operator: string,
|
|
1818
|
+
value: unknown
|
|
1819
|
+
): PostgrestFilterBuilder<ClientOptions, Schema, any, any, RelationName, Relationships, Method> {
|
|
1787
1820
|
this.url.searchParams.append(column, `not.${operator}.${value}`)
|
|
1788
|
-
return this
|
|
1821
|
+
return this as any
|
|
1789
1822
|
}
|
|
1790
1823
|
|
|
1791
1824
|
/**
|
|
@@ -48,7 +48,7 @@ export default class PostgrestQueryBuilder<
|
|
|
48
48
|
* ```ts
|
|
49
49
|
* import { createClient } from '@supabase/supabase-js'
|
|
50
50
|
*
|
|
51
|
-
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-
|
|
51
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')
|
|
52
52
|
* const { data, error } = await supabase.from('users').select('*')
|
|
53
53
|
* ```
|
|
54
54
|
*
|
|
@@ -58,7 +58,7 @@ export default class PostgrestQueryBuilder<
|
|
|
58
58
|
*
|
|
59
59
|
* const query = new PostgrestQueryBuilder(
|
|
60
60
|
* new URL('https://xyzcompany.supabase.co/rest/v1/users'),
|
|
61
|
-
* { headers: { apikey: 'publishable-
|
|
61
|
+
* { headers: { apikey: 'your-publishable-key' }, retry: true }
|
|
62
62
|
* )
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
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 = '3.0.0-next.
|
|
7
|
+
export const version = '3.0.0-next.10'
|