npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

drizquent

v0.3.3

Published

Eloquent-style ORM for Drizzle — Schema Builder, Artisan CLI, native Drizzle escape hatch

Downloads

332

Readme

Drizquent

Drizzle Eloquent — layer Eloquent-style di atas Drizzle ORM, dengan Schema Builder (mirip Laravel Blueprint), CLI Artisan-style, dan escape hatch Drizzle native.

npm version License: MIT

Fitur

  • ORM — CRUD, query builder, relasi, soft delete, scopes, pagination, hooks, casts
  • Schema BuilderdefineMigration.create/alter → SQL + sync schema/*.ts
  • CLImake:migration, make:model, migrate, rollback, db:seed, dll.
  • Native DrizzleModel.native(), Drizquent.transaction(), Drizquent.raw()

Requirements

| Package | Versi | |---------|-------| | Node.js | ≥ 18 | | drizzle-orm | ≥ 0.30 | | drizzle-kit | ≥ 0.31 | | Driver DB | better-sqlite3 · mysql2 · pg (pilih sesuai DB) |

Install

npx drizquent install

Atau manual:

npm install drizquent drizzle-orm drizzle-kit

# pilih driver:
npm install better-sqlite3   # SQLite
npm install mysql2           # MySQL
npm install pg               # PostgreSQL

npm install -D tsx typescript

Quick start (5 menit)

1. Config database

Lihat docs/GETTING-STARTED.md — contoh lengkap SQLite dan MySQL.

Ringkas (SQLite):

import path from "path";
import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import { defineConfig } from "drizzle-kit";
import * as schema from "../database/schema";

const dbPath = process.env.DATABASE_URL ?? "./data/app.db";

export const db = drizzle(new Database(dbPath), { schema });

export default defineConfig({
  schema: "./database/schema/index.ts",
  out: "./database/migrations",
  dialect: "sqlite",
  dbCredentials: { url: dbPath },
});

MySQL / PostgreSQL: set dialect: "mysql" atau "postgresql" — lihat GETTING-STARTED.

2. Boot Drizquent

import { Drizquent } from "drizquent";
import { db } from "./config/database";

Drizquent.boot({ db });
// Opsional production:
// Drizquent.boot({ db, preventLazyLoading: process.env.NODE_ENV === "production" });

3. Model

import { DrizquentModel } from "drizquent";
import { users } from "../database/schema/users";

export class User extends DrizquentModel {
  static override table = users;
  static override tableName = "users";
  static override primaryKey = "id";
  static override options = {
    timestamps: true,
    fillable: ["name", "email"],
  };
}

4. Migration + CLI

Tambahkan ke package.json project kamu:

{
  "scripts": {
    "db:migrate": "drizquent migrate",
    "db:rollback": "drizquent migrate:rollback",
    "db:status": "drizquent migrate:status",
    "db:fresh": "drizquent migrate:fresh --seed",
    "db:seed": "drizquent db:seed"
  }
}
npx drizquent make:migration create_users_table
# edit database/blueprints/0000_create_users_table.ts
npm run db:migrate

5. Pakai ORM

await User.spawn({ name: "Ali", email: "[email protected]" });
const users = await User.query().filter("status", "active").pull();
const page = await User.query().sortBy("createdAt", "desc").page({ page: 1, size: 20 });

Struktur folder (consumer)

your-app/
  config/database.ts       ← db + drizzle-kit config
  database/
    blueprints/              ← edit (Schema Builder)
    migrations/              ← auto-generated SQL
    schema/                  ← auto-synced Drizzle schema
    seeders/
    factories/
  src/models/                ← DrizquentModel classes

Dokumentasi

| Dokumen | Isi | |---------|-----| | docs/REFERENSI-LENGKAP.md | Referensi full — CLI, ORM, Schema Builder, semua parameter | | docs/GETTING-STARTED.md | Setup lengkap dari nol | | docs/CLI.md | Referensi semua perintah CLI | | docs/MIGRATION.md | Schema Builder, rollback, batch | | docs/PENGGUNAAN-ELOQUENT.md | Referensi API ORM | | docs/PRODUCTION.md | Deploy, CI/CD, checklist | | docs/STRUKTUR.md | Diagram arsitektur | | docs/NPM-PUBLISH.md | Publish ke npm + struktur repo | | examples/README.md | Contoh app Express lengkap |

CLI singkat

npx drizquent help

npx drizquent make:migration add_avatar_to_users
npx drizquent make:model User
npx drizquent make:seeder DatabaseSeeder
npx drizquent migrate              # compile + sync + apply
npx drizquent migrate --pretend    # dry-run SQL
npx drizquent migrate:rollback     # rollback batch terakhir
npx drizquent migrate:status
npx drizquent db:show
npx drizquent db:table users
npx drizquent db:studio

Export package

import { Drizquent, DrizquentModel, DrizquentQuery } from "drizquent";
import { defineMigration } from "drizquent/migrate";

Contoh lengkap

Repo ini menyertakan app Express di folder examples/:

git clone <repo>
cd drizquent
npm install
npm run db:migrate
npm run dev

License

MIT