Infer is a utility type that allows you to infer the type of a model from the columns.
import { Model, DataTypes } from "d1-orm";import type { Infer } from "d1-orm";const users = new Model( { tableName: "users", D1Orm: MyD1OrmInstance, }, { name: { type: DataTypes.STRING }, age: { type: DataTypes.NUMBER }, });type User = Infer<typeof users>;//type User = { //name: string, //age: number//}
Generated using TypeDoc
Infer is a utility type that allows you to infer the type of a model from the columns.
Example