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

dbcube

v5.2.16

Published

DBCube ORM: the fastest way to work with MySQL, PostgreSQL, SQLite and MongoDB in Node.js — daemon-powered query engine (sub-millisecond queries), fluent query builder, transactions, eager loading and .cube schema files.

Readme

Quickstart  •  Website  •  Docs  •  Examples  •  Benchmarks  •  Blog

What is Dbcube?

Dbcube is a modern ORM for Node.js & TypeScript. You write clean, fully typed code; a native Rust engine does query parsing, SQL generation, execution and row decoding off the event loop. The result is an ORM that's fast under real load and feels great to use.

  • 🦀 Rust core — the heavy lifting runs in compiled native code, not the JS event loop.
  • 🔒 Type-safe — generate types from your schema; queries are checked at compile time.
  • 🧩 One API, four enginesPostgreSQL, MySQL, SQLite and MongoDB with the same fluent builder.
  • ☁️ Cloud-ready — works with Supabase, Turso, PlanetScale, MongoDB Atlas, Neon, RDS over TLS.
  • 🧊 Schema as code — declarative .cube files, migrations with rollback, seeders and runtime triggers.
  • Fast — beats Prisma across the board in our reproducible benchmark.

Install

npm install dbcube

That's it — the native engine binary is fetched automatically for your platform (no C++ toolchain required).

Quickstart

1. Configure a connection in dbcube.config.js:

module.exports = (config) =>
  config.set({
    databases: {
      app: {
        type: "postgres", // "mysql" | "postgres" | "sqlite" | "mongodb"
        config: { URL: process.env.DATABASE_URL },
      },
    },
  });

2. Describe a table in dbcube/users.table.cube:

@database("app");

@meta({ name: "users"; description: "User accounts"; });

@columns({
  id:    { type: "int";     options: ["primary", "autoincrement"]; };
  name:  { type: "varchar"; length: "255"; options: ["not null"]; };
  email: { type: "varchar"; length: "255"; options: ["not null", "unique"]; };
  status:{ type: "varchar"; length: "20"; defaultValue: "active"; };
});

3. Create it and generate types:

npx dbcube run table:fresh   # create tables from your .cube files
npx dbcube generate          # write dbcube/types.ts

4. Query — typed end to end:

import { dbcube } from "dbcube";
import type { User } from "./dbcube/types";

const db = dbcube.database("app");

// read
const users = await db.table<User>("users")
  .where("status", "=", "active")
  .orderBy("age", "DESC")
  .limit(20)
  .get();                                   // → User[]

// write (insert returns the rows, with generated ids)
const [created] = await db.table<User>("users").insert([
  { name: "Ada Lovelace", email: "[email protected]" },
]);

// atomic transaction in ONE network round-trip
await db.batch((b) => {
  b.table("accounts").where("id", "=", 1).decrement("balance", 200);
  b.table("accounts").where("id", "=", 2).increment("balance", 200);
});

// eager-loaded relations, no N+1
const withOrders = await db.table<User>("users")
  .with("orders", { table: "orders", foreignKey: "user_id", type: "many" })
  .get();

Heads up: update() and delete() require a where() (no accidental mass writes), insert() always takes an array, and where() is always where(column, operator, value).

One API, every database

The same query code runs on every engine — only the config entry changes.

| Engine | type | Cloud hosts | |---|---|---| | PostgreSQL | postgres | Supabase · Neon · RDS | | MySQL | mysql | PlanetScale · Aiven | | SQLite | sqlite | Turso (libSQL) | | MongoDB | mongodb | MongoDB Atlas |

// Turso (SQLite at the edge)
edge: { type: "sqlite", config: { URL: process.env.TURSO_URL, AUTH_TOKEN: process.env.TURSO_TOKEN } }

Performance

Dbcube is benchmarked against Prisma, Drizzle, TypeORM and Knex on a real PostgreSQL 16 database — identical schema, data, machine and connection budget. It's #1 of all five at reads, transactions and concurrency, and beats Prisma on every operation. Where it isn't first (raw bulk insert → Knex), we say so.

The suite is fully reproducible — run it yourself:

git clone https://github.com/Dbcube/benchmarks && cd benchmarks
npm install && npm run db:up && npm run prepare:db && npx prisma generate && npm run bench

Full table & methodology → dbcube.dev/performance/benchmarks

The CLI

npx dbcube init                # scaffold a project
npx dbcube run table:fresh     # create tables from .cube files
npx dbcube run table:alter     # apply a .alter.cube (keeps data)
npx dbcube run seeder:add      # run a .seeder.cube
npx dbcube generate            # regenerate dbcube/types.ts
npx dbcube run pull            # introspect an existing DB into .cube files
npx dbcube migrate:rollback    # roll back the last migration
npx dbcube doctor              # health checks

Try it locally

This repo ships a Docker setup and a runnable starter so you can try Dbcube in under a minute:

git clone https://github.com/Dbcube/dbcube && cd dbcube
./scripts/db.sh up postgres            # start a local Postgres
cd examples/quickstart
npm install && npm run setup && npm start

What's in this repo

dbcube/
├── examples/quickstart/   a minimal, runnable Dbcube app
├── docker/                docker-compose for Postgres / MySQL / MongoDB
├── scripts/               db.sh — start/stop local databases
├── sandbox/               a scratch file to try queries
├── ARCHITECTURE.md        how Dbcube is put together (high level)
└── .env.example           connection strings for the docker databases

The native engine and the published packages are not in this repo — they're on npm (npm install dbcube). This is the community front door: docs, examples and setup. See ARCHITECTURE.md.

Ecosystem

| Repo | What | |---|---| | examples | Runnable examples + real-world use cases (blog, checkout, auth, dashboard) | | benchmarks | Reproducible benchmark suite vs Prisma/Drizzle/TypeORM/Knex | | skills | Official Claude Code skill — native Dbcube support in your editor | | vscode-extension-formater | .cube syntax highlighting, IntelliSense & validation |

Editor & AI tooling

  • VS Code — install the Dbcube extension for .cube highlighting and validation.
  • Claude Code​/plugin marketplace add Dbcube/skills then ​/plugin install dbcube@dbcube for native, accurate Dbcube assistance.

Community & support

If Dbcube is useful to you, please ★ star the repo — it genuinely helps.

Contributing

We welcome contributions! See CONTRIBUTING.md and our Code of Conduct.

Security

Found a vulnerability? Please report it privately — see SECURITY.md.

License

The dbcube packages and the contents of this repository are MIT licensed © Dbcube.

⚖️ The native engine binary is proprietary — no reverse engineering

The high-performance native engine binary (the Rust core, downloaded automatically on install) is NOT covered by the MIT license. It is proprietary software distributed under a separate, restrictive license, and it is the protected intellectual property of Dbcube.

You are strictly prohibited from:

  • Decompiling, disassembling, decompressing, unpacking, deobfuscating or reverse-engineering the binary, in whole or in part;
  • Attempting to derive, extract or reconstruct its source code, internal structure, algorithms, data formats or any other information from it;
  • Modifying, repackaging or redistributing the binary outside the official dbcube packages.

These actions are illegal, infringe Dbcube's intellectual property rights (including copyright and trade-secret protections) and may result in legal action. The binary may be used only as distributed, through the public dbcube API.