v0.5.0
Minor Changes
-
#44
101043b
Thanks @Skye-31! - Feat: Inferred Types!Models no longer require you to specify a definition when you create them. Instead, you can just pass in an object and the model will infer the types for you. See the following example:
import { Model, DataTypes } from "d1-orm"; import type { Infer } from "d1-orm"; const users = new Model( { tableName: "users", D1Orm: MyD1OrmInstance, }, { name: DataTypes.STRING, age: DataTypes.NUMBER, } ); type User = Infer<typeof users>; // type User = { // name: string, // age: number // }