This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
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
// }
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
d1-orm@0.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: