The options for the model. The table name & D1Orm instance are required.
The D1Orm instance to use.
The name of the table to use.
The columns for the model. The keys are the column names, and the values are the column options. See ModelColumn
Readonly
columnsA CreateTable definition for the model, which can be used in a CREATE TABLE statement.
Returns all rows that match the where clause.
The options for the query, see GenerateQueryOptions
The options for creating the table. Currently only contains strategy, which is the strategy to use when creating the table.
The options for the query, see GenerateQueryOptions
Returns the first row that matches the where clause, or null if no rows match.
The options for the query, see GenerateQueryOptions
The data to insert into the table, as an array of objects with the column names as keys and the values as values.
Throws an error if the data clause is empty.
The options for the query, see GenerateQueryOptions
Upserting is a way to insert a row into the table, or update it if it already exists. This is done by using SQLITE's ON CONFLICT clause. As a result, this method should control the primary key for the insert & where clauses, and should not be used with auto incrementing keys.
The options for the query, see GenerateQueryOptions
Generated using TypeDoc
The type of the model, which will be returned when using methods such as First() or All()