Parameters
The fetchOneRecord() method accepts a single object as its parameter with the following properties:
| Property | Type | Description | Required |
|---|---|---|---|
table | string | The name of the table from which to fetch the record. | Yes |
where | object | A filter object with conditions that specifies which record to fetch. | Yes |
fields | string[] | An array of strings specifying the fields (columns) to be retrieved from the record. If omitted, all fields will be fetched. | No |
with | Record<string, IncludeParams> | An object specifying related tables to include. This is used to fetch data from multiple tables in a single query. | No |