Skip to content

Commit 4eb5de5

Browse files
committed
update postgrest docs
1 parent eef85a4 commit 4eb5de5

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/PostgrestClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ export default class PostgrestClient<
6969
* @param fn The function name to call.
7070
* @param args The parameters to pass to the function call.
7171
* @param options Named parameters.
72-
* @param options.head When set to true, no data will be returned.
73-
* @param options.count Count algorithm to use to count rows in a table.
74-
* @param rollback Rollback the operation
7572
*/
7673
rpc<
7774
FunctionName extends string & keyof Schema['Functions'],
@@ -84,8 +81,11 @@ export default class PostgrestClient<
8481
count,
8582
rollback = false,
8683
}: {
84+
/** When set to true, no data will be returned. */
8785
head?: boolean
86+
/** Count algorithm to use to count rows in a table. */
8887
count?: 'exact' | 'planned' | 'estimated'
88+
/** Rollback the operation */
8989
rollback?: boolean
9090
} = {}
9191
): PostgrestFilterBuilder<

src/PostgrestQueryBuilder.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
3232
* Performs vertical filtering with SELECT.
3333
*
3434
* @param columns The columns to retrieve, separated by commas.
35-
* @param head When set to true, select will void data.
36-
* @param count Count algorithm to use to count rows in a table.
3735
*/
3836
select<
3937
Query extends string = '*',
@@ -44,7 +42,9 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
4442
head = false,
4543
count,
4644
}: {
45+
/** When set to true, select will void data. */
4746
head?: boolean
47+
/** Count algorithm to use to count rows in a table. */
4848
count?: 'exact' | 'planned' | 'estimated'
4949
} = {}
5050
): PostgrestFilterBuilder<Table['Row'], Result> {
@@ -82,16 +82,16 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
8282
* Performs an INSERT into the table.
8383
*
8484
* @param values The values to insert.
85-
* @param count Count algorithm to use to count rows in a table.
86-
* @param rollback Rollback the operation
8785
*/
8886
insert<Row extends Table['Insert']>(
8987
values: Row | Row[],
9088
{
9189
count,
9290
rollback = false,
9391
}: {
92+
/** Count algorithm to use to count rows in a table. */
9493
count?: 'exact' | 'planned' | 'estimated'
94+
/** Rollback the operation */
9595
rollback?: boolean
9696
} = {}
9797
): PostgrestFilterBuilder<Table['Row'], undefined> {
@@ -133,11 +133,6 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
133133
* Performs an UPSERT into the table.
134134
*
135135
* @param values The values to insert.
136-
* @param count Count algorithm to use to count rows in a table.
137-
* @param options Named parameters.
138-
* @param options.onConflict By specifying the `on_conflict` query parameter, you can make UPSERT work on a column(s) that has a UNIQUE constraint.
139-
* @param options.ignoreDuplicates Specifies if duplicate rows should be ignored and not inserted.
140-
* @param rollback Rollback the operation
141136
*/
142137
upsert<Row extends Table['Insert']>(
143138
values: Row | Row[],
@@ -147,9 +142,13 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
147142
ignoreDuplicates = false,
148143
rollback = false,
149144
}: {
145+
/** By specifying the `on_conflict` query parameter, you can make UPSERT work on a column(s) that has a UNIQUE constraint. */
150146
onConflict?: string
147+
/** Count algorithm to use to count rows in a table. */
151148
count?: 'exact' | 'planned' | 'estimated'
149+
/** Specifies if duplicate rows should be ignored and not inserted. */
152150
ignoreDuplicates?: boolean
151+
/** Rollback the operation */
153152
rollback?: boolean
154153
} = {}
155154
): PostgrestFilterBuilder<Table['Row'], undefined> {
@@ -185,16 +184,16 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
185184
* Performs an UPDATE on the table.
186185
*
187186
* @param values The values to update.
188-
* @param count Count algorithm to use to count rows in a table.
189-
* @param rollback Rollback the operation
190187
*/
191188
update<Row extends Table['Update']>(
192189
values: Row,
193190
{
194191
count,
195192
rollback = false,
196193
}: {
194+
/** Count algorithm to use to count rows in a table. */
197195
count?: 'exact' | 'planned' | 'estimated'
196+
/** Rollback the operation */
198197
rollback?: boolean
199198
} = {}
200199
): PostgrestFilterBuilder<Table['Row'], undefined> {
@@ -225,15 +224,14 @@ export default class PostgrestQueryBuilder<Table extends GenericTable> {
225224

226225
/**
227226
* Performs a DELETE on the table.
228-
*
229-
* @param count Count algorithm to use to count rows in a table.
230-
* @param rollback Rollback the operation
231227
*/
232228
delete({
233229
count,
234230
rollback = false,
235231
}: {
232+
/** Count algorithm to use to count rows in a table. */
236233
count?: 'exact' | 'planned' | 'estimated'
234+
/** Rollback the operation */
237235
rollback?: boolean
238236
} = {}): PostgrestFilterBuilder<Table['Row'], undefined> {
239237
const method = 'DELETE'

0 commit comments

Comments
 (0)