d1orm-neo
v0.1.1
Published
A Mongoose-style ORM for Cloudflare D1
Downloads
3
Maintainers
Readme
d1-mongoose-orm
A Mongoose-style ORM for Cloudflare D1 (serverless SQLite). Provides a familiar, type-safe, schema-based API for Cloudflare D1 developers, inspired by Mongoose.
Features
- Intuitive schema/model API
- TypeScript-first, but easy for JS users
- Chainable query builder
- Automatic id/timestamp fields
- Migrations support
- Zero-config, works out of the box with D1
Installation
npm install d1-mongoose-ormUsage
import orm from "d1-mongoose-orm";
const User = orm.model("User", {
name: { type: "string", required: true },
email: { type: "string", unique: true }
});
await User.create({ name: "Alice", email: "[email protected]" });
const users = await User.find().where({ name: "Alice" }).exec();Migrations
npx d1-mongoose-orm migrateLicense
MIT
