@bullet-js/orm
v1.0.3
Published
The official BulletJS ORM. A high-performance, developer-friendly database layer powered by [Kysely](https://kysely.dev).
Downloads
419
Readme
@bullet-js/orm
The official BulletJS ORM. A high-performance, developer-friendly database layer powered by Kysely.
Features
- ✅ Kysely Powered: Full SQL query builder with type safety.
- 🚀 Bun Native SQLite: Specialized dialect for lightning-fast synchronous SQLite operations.
- 💎 Laravel-style Models: Clean
Modelclass with hydration and lifecycle methods. - 📦 Collections: Rich, chainable collection objects for array-like result sets.
- 🔄 Multi-driver: Supports SQLite, MySQL, Postgres, and SQL Server.
Installation
bun add @bullet-js/orm kyselyBasic Usage
Define a Model
import { Model } from '@bullet-js/orm';
export class User extends Model {
protected static tableName = 'users';
}Fetch Data
// Get all users
const users = await User.all();
// Find by ID
const user = await User.find(1);
// Filter collection
const admins = users.filter(u => u.attributes.is_admin);Dialects
When using with SQLite on Bun, this package automatically uses a custom BunSqliteDialect to bridge Kysely with Bun's native synchronous driver, achieving superior performance compared to standard drivers.
