@supabase/postgrest-js 2.104.0-canary.1 → 2.104.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 +22 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -30
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +22 -30
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +22 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PostgrestBuilder.ts +6 -8
- package/src/PostgrestClient.ts +6 -20
- package/src/PostgrestQueryBuilder.ts +10 -2
- package/src/version.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,25 +103,23 @@ var PostgrestBuilder = class {
|
|
|
103
103
|
/**
|
|
104
104
|
* Creates a builder configured for a specific PostgREST request.
|
|
105
105
|
*
|
|
106
|
-
* @example
|
|
106
|
+
* @example Using supabase-js (recommended)
|
|
107
107
|
* ```ts
|
|
108
|
-
* import {
|
|
108
|
+
* import { createClient } from '@supabase/supabase-js'
|
|
109
109
|
*
|
|
110
|
-
* const
|
|
111
|
-
*
|
|
112
|
-
* { headers: new Headers({ apikey: 'public-anon-key' }) }
|
|
113
|
-
* )
|
|
110
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')
|
|
111
|
+
* const { data, error } = await supabase.from('users').select('*')
|
|
114
112
|
* ```
|
|
115
113
|
*
|
|
116
114
|
* @category Database
|
|
117
115
|
*
|
|
118
|
-
* @example
|
|
116
|
+
* @example Standalone import for bundle-sensitive environments
|
|
119
117
|
* ```ts
|
|
120
118
|
* import { PostgrestQueryBuilder } from '@supabase/postgrest-js'
|
|
121
119
|
*
|
|
122
120
|
* const builder = new PostgrestQueryBuilder(
|
|
123
121
|
* new URL('https://xyzcompany.supabase.co/rest/v1/users'),
|
|
124
|
-
* { headers: new Headers({ apikey: '
|
|
122
|
+
* { headers: new Headers({ apikey: 'publishable-or-anon-key' }) }
|
|
125
123
|
* )
|
|
126
124
|
* ```
|
|
127
125
|
*/
|
|
@@ -3088,13 +3086,21 @@ var PostgrestQueryBuilder = class {
|
|
|
3088
3086
|
* @param options.urlLengthLimit - Maximum URL length before warning
|
|
3089
3087
|
* @param options.retry - Enable automatic retries for transient errors (default: true)
|
|
3090
3088
|
*
|
|
3091
|
-
* @example
|
|
3089
|
+
* @example Using supabase-js (recommended)
|
|
3090
|
+
* ```ts
|
|
3091
|
+
* import { createClient } from '@supabase/supabase-js'
|
|
3092
|
+
*
|
|
3093
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')
|
|
3094
|
+
* const { data, error } = await supabase.from('users').select('*')
|
|
3095
|
+
* ```
|
|
3096
|
+
*
|
|
3097
|
+
* @example Standalone import for bundle-sensitive environments
|
|
3092
3098
|
* ```ts
|
|
3093
3099
|
* import { PostgrestQueryBuilder } from '@supabase/postgrest-js'
|
|
3094
3100
|
*
|
|
3095
3101
|
* const query = new PostgrestQueryBuilder(
|
|
3096
3102
|
* new URL('https://xyzcompany.supabase.co/rest/v1/users'),
|
|
3097
|
-
* { headers: { apikey: '
|
|
3103
|
+
* { headers: { apikey: 'publishable-or-anon-key' }, retry: true }
|
|
3098
3104
|
* )
|
|
3099
3105
|
* ```
|
|
3100
3106
|
*/
|
|
@@ -4668,15 +4674,12 @@ var PostgrestClient = class PostgrestClient {
|
|
|
4668
4674
|
* When enabled, idempotent requests (GET, HEAD, OPTIONS) that fail with network
|
|
4669
4675
|
* errors or HTTP 503/520 responses will be automatically retried up to 3 times
|
|
4670
4676
|
* with exponential backoff (1s, 2s, 4s). Defaults to `true`.
|
|
4671
|
-
* @example
|
|
4677
|
+
* @example Using supabase-js (recommended)
|
|
4672
4678
|
* ```ts
|
|
4673
|
-
* import {
|
|
4679
|
+
* import { createClient } from '@supabase/supabase-js'
|
|
4674
4680
|
*
|
|
4675
|
-
* const
|
|
4676
|
-
*
|
|
4677
|
-
* schema: 'public',
|
|
4678
|
-
* timeout: 30000, // 30 second timeout
|
|
4679
|
-
* })
|
|
4681
|
+
* const supabase = createClient('https://xyzcompany.supabase.co', 'publishable-or-anon-key')
|
|
4682
|
+
* const { data, error } = await supabase.from('profiles').select('*')
|
|
4680
4683
|
* ```
|
|
4681
4684
|
*
|
|
4682
4685
|
* @category Database
|
|
@@ -4685,25 +4688,14 @@ var PostgrestClient = class PostgrestClient {
|
|
|
4685
4688
|
* - A `timeout` option (in milliseconds) can be set to automatically abort requests that take too long.
|
|
4686
4689
|
* - A `urlLengthLimit` option (default: 8000) can be set to control when URL length warnings are included in error messages for aborted requests.
|
|
4687
4690
|
*
|
|
4688
|
-
* @example
|
|
4689
|
-
* ```ts
|
|
4690
|
-
* import { PostgrestClient } from '@supabase/postgrest-js'
|
|
4691
|
-
*
|
|
4692
|
-
* const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
|
|
4693
|
-
* headers: { apikey: 'public-anon-key' },
|
|
4694
|
-
* schema: 'public',
|
|
4695
|
-
* })
|
|
4696
|
-
* ```
|
|
4697
|
-
*
|
|
4698
|
-
* @example With timeout
|
|
4691
|
+
* @example Standalone import for bundle-sensitive environments
|
|
4699
4692
|
* ```ts
|
|
4700
4693
|
* import { PostgrestClient } from '@supabase/postgrest-js'
|
|
4701
4694
|
*
|
|
4702
4695
|
* const postgrest = new PostgrestClient('https://xyzcompany.supabase.co/rest/v1', {
|
|
4703
|
-
* headers: { apikey: '
|
|
4696
|
+
* headers: { apikey: 'publishable-or-anon-key' },
|
|
4704
4697
|
* schema: 'public',
|
|
4705
4698
|
* timeout: 30000, // 30 second timeout
|
|
4706
|
-
* retry: false, // Disable automatic retries
|
|
4707
4699
|
* })
|
|
4708
4700
|
* ```
|
|
4709
4701
|
*/
|