Interface: GenericDatabaseWriterWithTable<DataModel>
server.GenericDatabaseWriterWithTable
An interface to read from and write to the database within Convex mutation functions.
Convex guarantees that all writes within a single mutation are executed atomically, so you never have to worry about partial writes leaving your data in an inconsistent state. See the Convex Guide for the guarantees Convex provides your functions.
If you're using code generation, use the DatabaseReader
type in
convex/_generated/server.d.ts
which is typed for your data model.
Type parameters
Name | Type |
---|---|
DataModel | extends GenericDataModel |
Hierarchy
-
GenericDatabaseReaderWithTable
<DataModel
>↳
GenericDatabaseWriterWithTable
Properties
system
• system: BaseDatabaseReaderWithTable
<SystemDataModel
>
An interface to read from the system tables within Convex query functions
The two entry points are:
Inherited from
GenericDatabaseReaderWithTable.system
Defined in
Methods
table
▸ table<TableName
>(tableName
): BaseTableWriter
<DataModel
, TableName
>
Scope the database to a specific table.
Type parameters
Name | Type |
---|---|
TableName | extends string |
Parameters
Name | Type |
---|---|
tableName | TableName |
Returns
BaseTableWriter
<DataModel
, TableName
>
Overrides
GenericDatabaseReaderWithTable.table