@supabase/postgrest-js 1.15.5 → 1.15.6

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.
Files changed (95) hide show
  1. package/dist/{main → cjs}/PostgrestTransformBuilder.d.ts +1 -1
  2. package/dist/{main → cjs}/PostgrestTransformBuilder.js +1 -1
  3. package/dist/{main → cjs}/index.d.ts +1 -1
  4. package/dist/{main → cjs}/index.d.ts.map +1 -1
  5. package/dist/{main → cjs}/index.js +1 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/version.d.ts +2 -0
  8. package/dist/{main → cjs}/version.js +1 -1
  9. package/dist/esm/wrapper.mjs +25 -0
  10. package/package.json +14 -9
  11. package/src/PostgrestTransformBuilder.ts +1 -1
  12. package/src/index.ts +2 -1
  13. package/src/version.ts +1 -1
  14. package/dist/main/index.js.map +0 -1
  15. package/dist/main/version.d.ts +0 -2
  16. package/dist/module/PostgrestBuilder.d.ts +0 -22
  17. package/dist/module/PostgrestBuilder.d.ts.map +0 -1
  18. package/dist/module/PostgrestBuilder.js +0 -172
  19. package/dist/module/PostgrestBuilder.js.map +0 -1
  20. package/dist/module/PostgrestClient.d.ts +0 -72
  21. package/dist/module/PostgrestClient.d.ts.map +0 -1
  22. package/dist/module/PostgrestClient.js +0 -116
  23. package/dist/module/PostgrestClient.js.map +0 -1
  24. package/dist/module/PostgrestError.d.ts +0 -8
  25. package/dist/module/PostgrestError.d.ts.map +0 -1
  26. package/dist/module/PostgrestError.js +0 -10
  27. package/dist/module/PostgrestError.js.map +0 -1
  28. package/dist/module/PostgrestFilterBuilder.d.ts +0 -84
  29. package/dist/module/PostgrestFilterBuilder.d.ts.map +0 -1
  30. package/dist/module/PostgrestFilterBuilder.js +0 -375
  31. package/dist/module/PostgrestFilterBuilder.js.map +0 -1
  32. package/dist/module/PostgrestQueryBuilder.d.ts +0 -117
  33. package/dist/module/PostgrestQueryBuilder.d.ts.map +0 -1
  34. package/dist/module/PostgrestQueryBuilder.js +0 -265
  35. package/dist/module/PostgrestQueryBuilder.js.map +0 -1
  36. package/dist/module/PostgrestTransformBuilder.d.ts +0 -148
  37. package/dist/module/PostgrestTransformBuilder.d.ts.map +0 -1
  38. package/dist/module/PostgrestTransformBuilder.js +0 -215
  39. package/dist/module/PostgrestTransformBuilder.js.map +0 -1
  40. package/dist/module/constants.d.ts +0 -4
  41. package/dist/module/constants.d.ts.map +0 -1
  42. package/dist/module/constants.js +0 -3
  43. package/dist/module/constants.js.map +0 -1
  44. package/dist/module/index.d.ts +0 -7
  45. package/dist/module/index.d.ts.map +0 -1
  46. package/dist/module/index.js +0 -6
  47. package/dist/module/index.js.map +0 -1
  48. package/dist/module/select-query-parser.d.ts +0 -351
  49. package/dist/module/select-query-parser.d.ts.map +0 -1
  50. package/dist/module/select-query-parser.js +0 -4
  51. package/dist/module/select-query-parser.js.map +0 -1
  52. package/dist/module/types.d.ts +0 -62
  53. package/dist/module/types.d.ts.map +0 -1
  54. package/dist/module/types.js +0 -2
  55. package/dist/module/types.js.map +0 -1
  56. package/dist/module/version.d.ts +0 -2
  57. package/dist/module/version.d.ts.map +0 -1
  58. package/dist/module/version.js +0 -2
  59. package/dist/module/version.js.map +0 -1
  60. /package/dist/{main → cjs}/PostgrestBuilder.d.ts +0 -0
  61. /package/dist/{main → cjs}/PostgrestBuilder.d.ts.map +0 -0
  62. /package/dist/{main → cjs}/PostgrestBuilder.js +0 -0
  63. /package/dist/{main → cjs}/PostgrestBuilder.js.map +0 -0
  64. /package/dist/{main → cjs}/PostgrestClient.d.ts +0 -0
  65. /package/dist/{main → cjs}/PostgrestClient.d.ts.map +0 -0
  66. /package/dist/{main → cjs}/PostgrestClient.js +0 -0
  67. /package/dist/{main → cjs}/PostgrestClient.js.map +0 -0
  68. /package/dist/{main → cjs}/PostgrestError.d.ts +0 -0
  69. /package/dist/{main → cjs}/PostgrestError.d.ts.map +0 -0
  70. /package/dist/{main → cjs}/PostgrestError.js +0 -0
  71. /package/dist/{main → cjs}/PostgrestError.js.map +0 -0
  72. /package/dist/{main → cjs}/PostgrestFilterBuilder.d.ts +0 -0
  73. /package/dist/{main → cjs}/PostgrestFilterBuilder.d.ts.map +0 -0
  74. /package/dist/{main → cjs}/PostgrestFilterBuilder.js +0 -0
  75. /package/dist/{main → cjs}/PostgrestFilterBuilder.js.map +0 -0
  76. /package/dist/{main → cjs}/PostgrestQueryBuilder.d.ts +0 -0
  77. /package/dist/{main → cjs}/PostgrestQueryBuilder.d.ts.map +0 -0
  78. /package/dist/{main → cjs}/PostgrestQueryBuilder.js +0 -0
  79. /package/dist/{main → cjs}/PostgrestQueryBuilder.js.map +0 -0
  80. /package/dist/{main → cjs}/PostgrestTransformBuilder.d.ts.map +0 -0
  81. /package/dist/{main → cjs}/PostgrestTransformBuilder.js.map +0 -0
  82. /package/dist/{main → cjs}/constants.d.ts +0 -0
  83. /package/dist/{main → cjs}/constants.d.ts.map +0 -0
  84. /package/dist/{main → cjs}/constants.js +0 -0
  85. /package/dist/{main → cjs}/constants.js.map +0 -0
  86. /package/dist/{main → cjs}/select-query-parser.d.ts +0 -0
  87. /package/dist/{main → cjs}/select-query-parser.d.ts.map +0 -0
  88. /package/dist/{main → cjs}/select-query-parser.js +0 -0
  89. /package/dist/{main → cjs}/select-query-parser.js.map +0 -0
  90. /package/dist/{main → cjs}/types.d.ts +0 -0
  91. /package/dist/{main → cjs}/types.d.ts.map +0 -0
  92. /package/dist/{main → cjs}/types.js +0 -0
  93. /package/dist/{main → cjs}/types.js.map +0 -0
  94. /package/dist/{main → cjs}/version.d.ts.map +0 -0
  95. /package/dist/{main → cjs}/version.js.map +0 -0
@@ -1,265 +0,0 @@
1
- import PostgrestFilterBuilder from './PostgrestFilterBuilder';
2
- export default class PostgrestQueryBuilder {
3
- constructor(url, { headers = {}, schema, fetch, }) {
4
- this.url = url;
5
- this.headers = headers;
6
- this.schema = schema;
7
- this.fetch = fetch;
8
- }
9
- /**
10
- * Perform a SELECT query on the table or view.
11
- *
12
- * @param columns - The columns to retrieve, separated by commas. Columns can be renamed when returned with `customName:columnName`
13
- *
14
- * @param options - Named parameters
15
- *
16
- * @param options.head - When set to `true`, `data` will not be returned.
17
- * Useful if you only need the count.
18
- *
19
- * @param options.count - Count algorithm to use to count rows in the table or view.
20
- *
21
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
22
- * hood.
23
- *
24
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
25
- * statistics under the hood.
26
- *
27
- * `"estimated"`: Uses exact count for low numbers and planned count for high
28
- * numbers.
29
- */
30
- select(columns, { head = false, count, } = {}) {
31
- const method = head ? 'HEAD' : 'GET';
32
- // Remove whitespaces except when quoted
33
- let quoted = false;
34
- const cleanedColumns = (columns !== null && columns !== void 0 ? columns : '*')
35
- .split('')
36
- .map((c) => {
37
- if (/\s/.test(c) && !quoted) {
38
- return '';
39
- }
40
- if (c === '"') {
41
- quoted = !quoted;
42
- }
43
- return c;
44
- })
45
- .join('');
46
- this.url.searchParams.set('select', cleanedColumns);
47
- if (count) {
48
- this.headers['Prefer'] = `count=${count}`;
49
- }
50
- return new PostgrestFilterBuilder({
51
- method,
52
- url: this.url,
53
- headers: this.headers,
54
- schema: this.schema,
55
- fetch: this.fetch,
56
- allowEmpty: false,
57
- });
58
- }
59
- /**
60
- * Perform an INSERT into the table or view.
61
- *
62
- * By default, inserted rows are not returned. To return it, chain the call
63
- * with `.select()`.
64
- *
65
- * @param values - The values to insert. Pass an object to insert a single row
66
- * or an array to insert multiple rows.
67
- *
68
- * @param options - Named parameters
69
- *
70
- * @param options.count - Count algorithm to use to count inserted rows.
71
- *
72
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
73
- * hood.
74
- *
75
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
76
- * statistics under the hood.
77
- *
78
- * `"estimated"`: Uses exact count for low numbers and planned count for high
79
- * numbers.
80
- *
81
- * @param options.defaultToNull - Make missing fields default to `null`.
82
- * Otherwise, use the default value for the column. Only applies for bulk
83
- * inserts.
84
- */
85
- insert(values, { count, defaultToNull = true, } = {}) {
86
- const method = 'POST';
87
- const prefersHeaders = [];
88
- if (this.headers['Prefer']) {
89
- prefersHeaders.push(this.headers['Prefer']);
90
- }
91
- if (count) {
92
- prefersHeaders.push(`count=${count}`);
93
- }
94
- if (!defaultToNull) {
95
- prefersHeaders.push('missing=default');
96
- }
97
- this.headers['Prefer'] = prefersHeaders.join(',');
98
- if (Array.isArray(values)) {
99
- const columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);
100
- if (columns.length > 0) {
101
- const uniqueColumns = [...new Set(columns)].map((column) => `"${column}"`);
102
- this.url.searchParams.set('columns', uniqueColumns.join(','));
103
- }
104
- }
105
- return new PostgrestFilterBuilder({
106
- method,
107
- url: this.url,
108
- headers: this.headers,
109
- schema: this.schema,
110
- body: values,
111
- fetch: this.fetch,
112
- allowEmpty: false,
113
- });
114
- }
115
- /**
116
- * Perform an UPSERT on the table or view. Depending on the column(s) passed
117
- * to `onConflict`, `.upsert()` allows you to perform the equivalent of
118
- * `.insert()` if a row with the corresponding `onConflict` columns doesn't
119
- * exist, or if it does exist, perform an alternative action depending on
120
- * `ignoreDuplicates`.
121
- *
122
- * By default, upserted rows are not returned. To return it, chain the call
123
- * with `.select()`.
124
- *
125
- * @param values - The values to upsert with. Pass an object to upsert a
126
- * single row or an array to upsert multiple rows.
127
- *
128
- * @param options - Named parameters
129
- *
130
- * @param options.onConflict - Comma-separated UNIQUE column(s) to specify how
131
- * duplicate rows are determined. Two rows are duplicates if all the
132
- * `onConflict` columns are equal.
133
- *
134
- * @param options.ignoreDuplicates - If `true`, duplicate rows are ignored. If
135
- * `false`, duplicate rows are merged with existing rows.
136
- *
137
- * @param options.count - Count algorithm to use to count upserted rows.
138
- *
139
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
140
- * hood.
141
- *
142
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
143
- * statistics under the hood.
144
- *
145
- * `"estimated"`: Uses exact count for low numbers and planned count for high
146
- * numbers.
147
- *
148
- * @param options.defaultToNull - Make missing fields default to `null`.
149
- * Otherwise, use the default value for the column. This only applies when
150
- * inserting new rows, not when merging with existing rows under
151
- * `ignoreDuplicates: false`. This also only applies when doing bulk upserts.
152
- */
153
- upsert(values, { onConflict, ignoreDuplicates = false, count, defaultToNull = true, } = {}) {
154
- const method = 'POST';
155
- const prefersHeaders = [`resolution=${ignoreDuplicates ? 'ignore' : 'merge'}-duplicates`];
156
- if (onConflict !== undefined)
157
- this.url.searchParams.set('on_conflict', onConflict);
158
- if (this.headers['Prefer']) {
159
- prefersHeaders.push(this.headers['Prefer']);
160
- }
161
- if (count) {
162
- prefersHeaders.push(`count=${count}`);
163
- }
164
- if (!defaultToNull) {
165
- prefersHeaders.push('missing=default');
166
- }
167
- this.headers['Prefer'] = prefersHeaders.join(',');
168
- if (Array.isArray(values)) {
169
- const columns = values.reduce((acc, x) => acc.concat(Object.keys(x)), []);
170
- if (columns.length > 0) {
171
- const uniqueColumns = [...new Set(columns)].map((column) => `"${column}"`);
172
- this.url.searchParams.set('columns', uniqueColumns.join(','));
173
- }
174
- }
175
- return new PostgrestFilterBuilder({
176
- method,
177
- url: this.url,
178
- headers: this.headers,
179
- schema: this.schema,
180
- body: values,
181
- fetch: this.fetch,
182
- allowEmpty: false,
183
- });
184
- }
185
- /**
186
- * Perform an UPDATE on the table or view.
187
- *
188
- * By default, updated rows are not returned. To return it, chain the call
189
- * with `.select()` after filters.
190
- *
191
- * @param values - The values to update with
192
- *
193
- * @param options - Named parameters
194
- *
195
- * @param options.count - Count algorithm to use to count updated rows.
196
- *
197
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
198
- * hood.
199
- *
200
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
201
- * statistics under the hood.
202
- *
203
- * `"estimated"`: Uses exact count for low numbers and planned count for high
204
- * numbers.
205
- */
206
- update(values, { count, } = {}) {
207
- const method = 'PATCH';
208
- const prefersHeaders = [];
209
- if (this.headers['Prefer']) {
210
- prefersHeaders.push(this.headers['Prefer']);
211
- }
212
- if (count) {
213
- prefersHeaders.push(`count=${count}`);
214
- }
215
- this.headers['Prefer'] = prefersHeaders.join(',');
216
- return new PostgrestFilterBuilder({
217
- method,
218
- url: this.url,
219
- headers: this.headers,
220
- schema: this.schema,
221
- body: values,
222
- fetch: this.fetch,
223
- allowEmpty: false,
224
- });
225
- }
226
- /**
227
- * Perform a DELETE on the table or view.
228
- *
229
- * By default, deleted rows are not returned. To return it, chain the call
230
- * with `.select()` after filters.
231
- *
232
- * @param options - Named parameters
233
- *
234
- * @param options.count - Count algorithm to use to count deleted rows.
235
- *
236
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
237
- * hood.
238
- *
239
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
240
- * statistics under the hood.
241
- *
242
- * `"estimated"`: Uses exact count for low numbers and planned count for high
243
- * numbers.
244
- */
245
- delete({ count, } = {}) {
246
- const method = 'DELETE';
247
- const prefersHeaders = [];
248
- if (count) {
249
- prefersHeaders.push(`count=${count}`);
250
- }
251
- if (this.headers['Prefer']) {
252
- prefersHeaders.unshift(this.headers['Prefer']);
253
- }
254
- this.headers['Prefer'] = prefersHeaders.join(',');
255
- return new PostgrestFilterBuilder({
256
- method,
257
- url: this.url,
258
- headers: this.headers,
259
- schema: this.schema,
260
- fetch: this.fetch,
261
- allowEmpty: false,
262
- });
263
- }
264
- }
265
- //# sourceMappingURL=PostgrestQueryBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PostgrestQueryBuilder.js","sourceRoot":"","sources":["../../src/PostgrestQueryBuilder.ts"],"names":[],"mappings":"AACA,OAAO,sBAAsB,MAAM,0BAA0B,CAAA;AAI7D,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAYxC,YACE,GAAQ,EACR,EACE,OAAO,GAAG,EAAE,EACZ,MAAM,EACN,KAA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O,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,KAAK;SACmB,CAAC,CAAA;IACzC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,EACL,KAAK,MAGH,EAAE;QACJ,MAAM,MAAM,GAAG,QAAQ,CAAA;QACvB,MAAM,cAAc,GAAG,EAAE,CAAA;QACzB,IAAI,KAAK,EAAE;YACT,cAAc,CAAC,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC,CAAA;SACtC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC1B,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;SAC/C;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjD,OAAO,IAAI,sBAAsB,CAAC;YAChC,MAAM;YACN,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,KAAK;SACmB,CAAC,CAAA;IACzC,CAAC;CACF"}
@@ -1,148 +0,0 @@
1
- import PostgrestBuilder from './PostgrestBuilder';
2
- import { GetResult } from './select-query-parser';
3
- import { GenericSchema } from './types';
4
- export default class PostgrestTransformBuilder<Schema extends GenericSchema, Row extends Record<string, unknown>, Result, RelationName = unknown, Relationships = unknown> extends PostgrestBuilder<Result> {
5
- /**
6
- * Perform a SELECT on the query result.
7
- *
8
- * By default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not
9
- * return modified rows. By calling this method, modified rows are returned in
10
- * `data`.
11
- *
12
- * @param columns - The columns to retrieve, separated by commas
13
- */
14
- select<Query extends string = '*', NewResultOne = GetResult<Schema, Row, RelationName, Relationships, Query>>(columns?: Query): PostgrestTransformBuilder<Schema, Row, NewResultOne[], RelationName, Relationships>;
15
- order<ColumnName extends string & keyof Row>(column: ColumnName, options?: {
16
- ascending?: boolean;
17
- nullsFirst?: boolean;
18
- referencedTable?: undefined;
19
- }): this;
20
- order(column: string, options?: {
21
- ascending?: boolean;
22
- nullsFirst?: boolean;
23
- referencedTable?: string;
24
- }): this;
25
- /**
26
- * @deprecated Use `options.referencedTable` instead of `options.foreignTable`
27
- */
28
- order<ColumnName extends string & keyof Row>(column: ColumnName, options?: {
29
- ascending?: boolean;
30
- nullsFirst?: boolean;
31
- foreignTable?: undefined;
32
- }): this;
33
- /**
34
- * @deprecated Use `options.referencedTable` instead of `options.foreignTable`
35
- */
36
- order(column: string, options?: {
37
- ascending?: boolean;
38
- nullsFirst?: boolean;
39
- foreignTable?: string;
40
- }): this;
41
- /**
42
- * Limit the query result by `count`.
43
- *
44
- * @param count - The maximum number of rows to return
45
- * @param options - Named parameters
46
- * @param options.referencedTable - Set this to limit rows of referenced
47
- * tables instead of the parent table
48
- * @param options.foreignTable - Deprecated, use `options.referencedTable`
49
- * instead
50
- */
51
- limit(count: number, { foreignTable, referencedTable, }?: {
52
- foreignTable?: string;
53
- referencedTable?: string;
54
- }): this;
55
- /**
56
- * Limit the query result by starting at an offset (`from`) and ending at the offset (`from + to`).
57
- * Only records within this range are returned.
58
- * This respects the query order and if there is no order clause the range could behave unexpectedly.
59
- * The `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third
60
- * and fourth rows of the query.
61
- *
62
- * @param from - The starting index from which to limit the result
63
- * @param to - The last index to which to limit the result
64
- * @param options - Named parameters
65
- * @param options.referencedTable - Set this to limit rows of referenced
66
- * tables instead of the parent table
67
- * @param options.foreignTable - Deprecated, use `options.referencedTable`
68
- * instead
69
- */
70
- range(from: number, to: number, { foreignTable, referencedTable, }?: {
71
- foreignTable?: string;
72
- referencedTable?: string;
73
- }): this;
74
- /**
75
- * Set the AbortSignal for the fetch request.
76
- *
77
- * @param signal - The AbortSignal to use for the fetch request
78
- */
79
- abortSignal(signal: AbortSignal): this;
80
- /**
81
- * Return `data` as a single object instead of an array of objects.
82
- *
83
- * Query result must be one row (e.g. using `.limit(1)`), otherwise this
84
- * returns an error.
85
- */
86
- single<ResultOne = Result extends (infer ResultOne)[] ? ResultOne : never>(): PostgrestBuilder<ResultOne>;
87
- /**
88
- * Return `data` as a single object instead of an array of objects.
89
- *
90
- * Query result must be zero or one row (e.g. using `.limit(1)`), otherwise
91
- * this returns an error.
92
- */
93
- maybeSingle<ResultOne = Result extends (infer ResultOne)[] ? ResultOne : never>(): PostgrestBuilder<ResultOne | null>;
94
- /**
95
- * Return `data` as a string in CSV format.
96
- */
97
- csv(): PostgrestBuilder<string>;
98
- /**
99
- * Return `data` as an object in [GeoJSON](https://geojson.org) format.
100
- */
101
- geojson(): PostgrestBuilder<Record<string, unknown>>;
102
- /**
103
- * Return `data` as the EXPLAIN plan for the query.
104
- *
105
- * You need to enable the
106
- * [db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)
107
- * setting before using this method.
108
- *
109
- * @param options - Named parameters
110
- *
111
- * @param options.analyze - If `true`, the query will be executed and the
112
- * actual run time will be returned
113
- *
114
- * @param options.verbose - If `true`, the query identifier will be returned
115
- * and `data` will include the output columns of the query
116
- *
117
- * @param options.settings - If `true`, include information on configuration
118
- * parameters that affect query planning
119
- *
120
- * @param options.buffers - If `true`, include information on buffer usage
121
- *
122
- * @param options.wal - If `true`, include information on WAL record generation
123
- *
124
- * @param options.format - The format of the output, can be `"text"` (default)
125
- * or `"json"`
126
- */
127
- explain({ analyze, verbose, settings, buffers, wal, format, }?: {
128
- analyze?: boolean;
129
- verbose?: boolean;
130
- settings?: boolean;
131
- buffers?: boolean;
132
- wal?: boolean;
133
- format?: 'json' | 'text';
134
- }): PostgrestBuilder<Record<string, unknown>[]> | PostgrestBuilder<string>;
135
- /**
136
- * Rollback the query.
137
- *
138
- * `data` will still be returned, but the query is not committed.
139
- */
140
- rollback(): this;
141
- /**
142
- * Override the type of the returned `data`.
143
- *
144
- * @typeParam NewResult - The new result type to override with
145
- */
146
- returns<NewResult>(): PostgrestTransformBuilder<Schema, Row, NewResult, RelationName, Relationships>;
147
- }
148
- //# sourceMappingURL=PostgrestTransformBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PostgrestTransformBuilder.d.ts","sourceRoot":"","sources":["../../src/PostgrestTransformBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,yBAAyB,CAC5C,MAAM,SAAS,aAAa,EAC5B,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EACN,YAAY,GAAG,OAAO,EACtB,aAAa,GAAG,OAAO,CACvB,SAAQ,gBAAgB,CAAC,MAAM,CAAC;IAChC;;;;;;;;OAQG;IACH,MAAM,CACJ,KAAK,SAAS,MAAM,GAAG,GAAG,EAC1B,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,CAAC,EAEzE,OAAO,CAAC,EAAE,KAAK,GACd,yBAAyB,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,YAAY,EAAE,aAAa,CAAC;IA6BtF,KAAK,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM,GAAG,EACzC,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,SAAS,CAAA;KAAE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AAC,SAAS,CAAC;IAKhC;;;;;OAKG;IACH,WAAW,CACT,SAAS,GAAG,MAAM,SAAS,CAAC,MAAM,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,KAAK,KAC/D,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;IAYvC;;OAEG;IACH,GAAG,IAAI,gBAAgB,CAAC,MAAM,CAAC;IAK/B;;OAEG;IACH,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKpD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,OAAO,CAAC,EACN,OAAe,EACf,OAAe,EACf,QAAgB,EAChB,OAAe,EACf,GAAW,EACX,MAAe,GAChB,GAAE;QACD,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,GAAG,CAAC,EAAE,OAAO,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KACpB,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAmB/E;;;;OAIG;IACH,QAAQ,IAAI,IAAI;IAShB;;;;OAIG;IACH,OAAO,CAAC,SAAS,KAAK,yBAAyB,CAC7C,MAAM,EACN,GAAG,EACH,SAAS,EACT,YAAY,EACZ,aAAa,CACd;CASF"}
@@ -1,215 +0,0 @@
1
- import PostgrestBuilder from './PostgrestBuilder';
2
- export default class PostgrestTransformBuilder extends PostgrestBuilder {
3
- /**
4
- * Perform a SELECT on the query result.
5
- *
6
- * By default, `.insert()`, `.update()`, `.upsert()`, and `.delete()` do not
7
- * return modified rows. By calling this method, modified rows are returned in
8
- * `data`.
9
- *
10
- * @param columns - The columns to retrieve, separated by commas
11
- */
12
- select(columns) {
13
- // Remove whitespaces except when quoted
14
- let quoted = false;
15
- const cleanedColumns = (columns !== null && columns !== void 0 ? columns : '*')
16
- .split('')
17
- .map((c) => {
18
- if (/\s/.test(c) && !quoted) {
19
- return '';
20
- }
21
- if (c === '"') {
22
- quoted = !quoted;
23
- }
24
- return c;
25
- })
26
- .join('');
27
- this.url.searchParams.set('select', cleanedColumns);
28
- if (this.headers['Prefer']) {
29
- this.headers['Prefer'] += ',';
30
- }
31
- this.headers['Prefer'] += 'return=representation';
32
- return this;
33
- }
34
- /**
35
- * Order the query result by `column`.
36
- *
37
- * You can call this method multiple times to order by multiple columns.
38
- *
39
- * You can order referenced tables, but it only affects the ordering of the
40
- * parent table if you use `!inner` in the query.
41
- *
42
- * @param column - The column to order by
43
- * @param options - Named parameters
44
- * @param options.ascending - If `true`, the result will be in ascending order
45
- * @param options.nullsFirst - If `true`, `null`s appear first. If `false`,
46
- * `null`s appear last.
47
- * @param options.referencedTable - Set this to order a referenced table by
48
- * its columns
49
- * @param options.foreignTable - Deprecated, use `options.referencedTable`
50
- * instead
51
- */
52
- order(column, { ascending = true, nullsFirst, foreignTable, referencedTable = foreignTable, } = {}) {
53
- const key = referencedTable ? `${referencedTable}.order` : 'order';
54
- const existingOrder = this.url.searchParams.get(key);
55
- this.url.searchParams.set(key, `${existingOrder ? `${existingOrder},` : ''}${column}.${ascending ? 'asc' : 'desc'}${nullsFirst === undefined ? '' : nullsFirst ? '.nullsfirst' : '.nullslast'}`);
56
- return this;
57
- }
58
- /**
59
- * Limit the query result by `count`.
60
- *
61
- * @param count - The maximum number of rows to return
62
- * @param options - Named parameters
63
- * @param options.referencedTable - Set this to limit rows of referenced
64
- * tables instead of the parent table
65
- * @param options.foreignTable - Deprecated, use `options.referencedTable`
66
- * instead
67
- */
68
- limit(count, { foreignTable, referencedTable = foreignTable, } = {}) {
69
- const key = typeof referencedTable === 'undefined' ? 'limit' : `${referencedTable}.limit`;
70
- this.url.searchParams.set(key, `${count}`);
71
- return this;
72
- }
73
- /**
74
- * Limit the query result by starting at an offset (`from`) and ending at the offset (`from + to`).
75
- * Only records within this range are returned.
76
- * This respects the query order and if there is no order clause the range could behave unexpectedly.
77
- * The `from` and `to` values are 0-based and inclusive: `range(1, 3)` will include the second, third
78
- * and fourth rows of the query.
79
- *
80
- * @param from - The starting index from which to limit the result
81
- * @param to - The last index to which to limit the result
82
- * @param options - Named parameters
83
- * @param options.referencedTable - Set this to limit rows of referenced
84
- * tables instead of the parent table
85
- * @param options.foreignTable - Deprecated, use `options.referencedTable`
86
- * instead
87
- */
88
- range(from, to, { foreignTable, referencedTable = foreignTable, } = {}) {
89
- const keyOffset = typeof referencedTable === 'undefined' ? 'offset' : `${referencedTable}.offset`;
90
- const keyLimit = typeof referencedTable === 'undefined' ? 'limit' : `${referencedTable}.limit`;
91
- this.url.searchParams.set(keyOffset, `${from}`);
92
- // Range is inclusive, so add 1
93
- this.url.searchParams.set(keyLimit, `${to - from + 1}`);
94
- return this;
95
- }
96
- /**
97
- * Set the AbortSignal for the fetch request.
98
- *
99
- * @param signal - The AbortSignal to use for the fetch request
100
- */
101
- abortSignal(signal) {
102
- this.signal = signal;
103
- return this;
104
- }
105
- /**
106
- * Return `data` as a single object instead of an array of objects.
107
- *
108
- * Query result must be one row (e.g. using `.limit(1)`), otherwise this
109
- * returns an error.
110
- */
111
- single() {
112
- this.headers['Accept'] = 'application/vnd.pgrst.object+json';
113
- return this;
114
- }
115
- /**
116
- * Return `data` as a single object instead of an array of objects.
117
- *
118
- * Query result must be zero or one row (e.g. using `.limit(1)`), otherwise
119
- * this returns an error.
120
- */
121
- maybeSingle() {
122
- // Temporary partial fix for https://github.com/supabase/postgrest-js/issues/361
123
- // Issue persists e.g. for `.insert([...]).select().maybeSingle()`
124
- if (this.method === 'GET') {
125
- this.headers['Accept'] = 'application/json';
126
- }
127
- else {
128
- this.headers['Accept'] = 'application/vnd.pgrst.object+json';
129
- }
130
- this.isMaybeSingle = true;
131
- return this;
132
- }
133
- /**
134
- * Return `data` as a string in CSV format.
135
- */
136
- csv() {
137
- this.headers['Accept'] = 'text/csv';
138
- return this;
139
- }
140
- /**
141
- * Return `data` as an object in [GeoJSON](https://geojson.org) format.
142
- */
143
- geojson() {
144
- this.headers['Accept'] = 'application/geo+json';
145
- return this;
146
- }
147
- /**
148
- * Return `data` as the EXPLAIN plan for the query.
149
- *
150
- * You need to enable the
151
- * [db_plan_enabled](https://supabase.com/docs/guides/database/debugging-performance#enabling-explain)
152
- * setting before using this method.
153
- *
154
- * @param options - Named parameters
155
- *
156
- * @param options.analyze - If `true`, the query will be executed and the
157
- * actual run time will be returned
158
- *
159
- * @param options.verbose - If `true`, the query identifier will be returned
160
- * and `data` will include the output columns of the query
161
- *
162
- * @param options.settings - If `true`, include information on configuration
163
- * parameters that affect query planning
164
- *
165
- * @param options.buffers - If `true`, include information on buffer usage
166
- *
167
- * @param options.wal - If `true`, include information on WAL record generation
168
- *
169
- * @param options.format - The format of the output, can be `"text"` (default)
170
- * or `"json"`
171
- */
172
- explain({ analyze = false, verbose = false, settings = false, buffers = false, wal = false, format = 'text', } = {}) {
173
- var _a;
174
- const options = [
175
- analyze ? 'analyze' : null,
176
- verbose ? 'verbose' : null,
177
- settings ? 'settings' : null,
178
- buffers ? 'buffers' : null,
179
- wal ? 'wal' : null,
180
- ]
181
- .filter(Boolean)
182
- .join('|');
183
- // An Accept header can carry multiple media types but postgrest-js always sends one
184
- const forMediatype = (_a = this.headers['Accept']) !== null && _a !== void 0 ? _a : 'application/json';
185
- this.headers['Accept'] = `application/vnd.pgrst.plan+${format}; for="${forMediatype}"; options=${options};`;
186
- if (format === 'json')
187
- return this;
188
- else
189
- return this;
190
- }
191
- /**
192
- * Rollback the query.
193
- *
194
- * `data` will still be returned, but the query is not committed.
195
- */
196
- rollback() {
197
- var _a;
198
- if (((_a = this.headers['Prefer']) !== null && _a !== void 0 ? _a : '').trim().length > 0) {
199
- this.headers['Prefer'] += ',tx=rollback';
200
- }
201
- else {
202
- this.headers['Prefer'] = 'tx=rollback';
203
- }
204
- return this;
205
- }
206
- /**
207
- * Override the type of the returned `data`.
208
- *
209
- * @typeParam NewResult - The new result type to override with
210
- */
211
- returns() {
212
- return this;
213
- }
214
- }
215
- //# sourceMappingURL=PostgrestTransformBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PostgrestTransformBuilder.js","sourceRoot":"","sources":["../../src/PostgrestTransformBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AAIjD,MAAM,CAAC,OAAO,OAAO,yBAMnB,SAAQ,gBAAwB;IAChC;;;;;;;;OAQG;IACH,MAAM,CAIJ,OAAe;QAEf,wCAAwC;QACxC,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,MAAM,cAAc,GAAG,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,GAAG,CAAC;aACpC,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;gBAC3B,OAAO,EAAE,CAAA;aACV;YACD,IAAI,CAAC,KAAK,GAAG,EAAE;gBACb,MAAM,GAAG,CAAC,MAAM,CAAA;aACjB;YACD,OAAO,CAAC,CAAA;QACV,CAAC,CAAC;aACD,IAAI,CAAC,EAAE,CAAC,CAAA;QACX,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;QACnD,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC1B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAA;SAC9B;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,uBAAuB,CAAA;QACjD,OAAO,IAMN,CAAA;IACH,CAAC;IAwBD;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CACH,MAAc,EACd,EACE,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O,IAMN,CAAA;IACH,CAAC;CACF"}
@@ -1,4 +0,0 @@
1
- export declare const DEFAULT_HEADERS: {
2
- 'X-Client-Info': string;
3
- };
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe;;CAAiD,CAAA"}
@@ -1,3 +0,0 @@
1
- import { version } from './version';
2
- export const DEFAULT_HEADERS = { 'X-Client-Info': `postgrest-js/${version}` };
3
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,eAAe,EAAE,gBAAgB,OAAO,EAAE,EAAE,CAAA"}