Interface: BaseTableReader<DataModel, TableName>
server.BaseTableReader
Type parameters
Name | Type |
---|---|
DataModel | extends GenericDataModel |
TableName | extends TableNamesInDataModel <DataModel > |
Hierarchy
-
BaseTableReader
Methods
get
▸ get(id
): Promise
<null
| DocumentByName
<DataModel
, TableName
>>
Fetch a single document from the table by its GenericId.
Parameters
Name | Type | Description |
---|---|---|
id | GenericId <TableName > | The GenericId of the document to fetch from the database. |
Returns
Promise
<null
| DocumentByName
<DataModel
, TableName
>>
- The GenericDocument of the document at the given GenericId, or
null
if it no longer exists.
Defined in
query
▸ query(): QueryInitializer
<NamedTableInfo
<DataModel
, TableName
>>
Begin a query for the table.
Queries don't execute immediately, so calling this method and extending its query are free until the results are actually used.
Returns
QueryInitializer
<NamedTableInfo
<DataModel
, TableName
>>
- A QueryInitializer object to start building a query.