An ActiveRecord-inspired ORM and migration tool for Bun, version 0.14.3. PostgreSQL-native with auto-generated typed schemas from introspection. Release cadence is monthly. Key differentiators: convention-over-configuration, single `db/schema.ts` generated by migrations that feeds both backend models and frontend hydration, TypeScript-first, supports lazy/eager loading, polymorphic associations, soft deletes, recursive tree traversal, and serialization with `__typename` for frontend hydration.
npm install baked-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows defining backend models with associations, connecting to the database, querying with eager loading, and serializing with __typename.
Do not edit db/schema.ts directly; treat it as generated code. For custom types, use raw SQL or define them in separate TS files.
Check the CLI help with `bun bake --help` for the latest syntax; consider creating migration files manually.
Wrap the Model call in a class declaration: `class User extends Model(users, { ... }) {}`Specify `foreignKey` in association options if your column name doesn't match the default pattern.
Always use `serialize()` method on backend models to include `__typename` automatically.
Run `bun add baked-orm` and ensure tsconfig.json includes `"moduleResolution": "bundler"` or `"node"`.
Ensure PostgreSQL is running and DATABASE_URL is set correctly in .env, e.g., `DATABASE_URL=postgres://user:pass@localhost:5432/mydb`.
Use `import { Model } from 'baked-orm'` instead of default import.Run `bun bake db migrate up` to generate db/schema.ts from migration files.
Ensure you are calling serialize on an instance of a class that extends Model(table, association).