Skip to content

Commit 2ddd9fc

Browse files
committed
chore: update docstrings
1 parent 52024db commit 2ddd9fc

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

src/SupabaseClient.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,6 @@ export default class SupabaseClient<
149149
return new SupabaseStorageClient(this.storageUrl, this.headers, this.fetch)
150150
}
151151

152-
/**
153-
* Perform a table operation.
154-
*
155-
* @param table The table name to operate on.
156-
*/
157152
from<
158153
TableName extends string & keyof Schema['Tables'],
159154
Table extends Schema['Tables'][TableName]
@@ -162,18 +157,35 @@ export default class SupabaseClient<
162157
relation: ViewName
163158
): PostgrestQueryBuilder<Schema, View>
164159
from(relation: string): PostgrestQueryBuilder<Schema, any>
160+
/**
161+
* Perform a query on a table or a view.
162+
*
163+
* @param relation - The table or view name to query
164+
*/
165165
from(relation: string): PostgrestQueryBuilder<Schema, any> {
166166
return this.rest.from(relation)
167167
}
168168

169169
/**
170170
* Perform a function call.
171171
*
172-
* @param fn The function name to call.
173-
* @param args The parameters to pass to the function call.
174-
* @param options.head When set to true, no data will be returned.
175-
* @param options.count Count algorithm to use to count rows in a table.
172+
* @param fn - The function name to call
173+
* @param args - The arguments to pass to the function call
174+
* @param options - Named parameters
175+
* @param options.head - When set to `true`, `data` will not be returned.
176+
* Useful if you only need the count.
177+
* @param options.count - Count algorithm to use to count rows returned by the
178+
* function. Only applicable for [set-returning
179+
* functions](https://www.postgresql.org/docs/current/functions-srf.html).
180+
*
181+
* `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
182+
* hood.
183+
*
184+
* `"planned"`: Approximated but fast count algorithm. Uses the Postgres
185+
* statistics under the hood.
176186
*
187+
* `"estimated"`: Uses exact count for low numbers and planned count for high
188+
* numbers.
177189
*/
178190
rpc<
179191
FunctionName extends string & keyof Schema['Functions'],

0 commit comments

Comments
 (0)