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

pawql

v0.3.0

Published

The Runtime-First ORM for TypeScript. Type-safe database query builder with zero code generation.

Readme

PawQL

The Runtime-First ORM for TypeScript — Zero code generation. Zero build step. Full type safety.

PawQL is a modern, type-safe database query builder that infers types directly from your runtime schema definition. No CLI tools, no .prisma files, no generated code.

npm version License: MIT

Why PawQL?

| Feature | Prisma | Drizzle | PawQL | |---------|--------|---------|-----------| | Code Generation | ✅ Required | ⚠ Optional | ❌ Not needed | | Build Step | ✅ Required | ⚠ Sometimes | ❌ Not needed | | Runtime Schema | ❌ | ❌ | ✅ Yes | | Type Safety | ✅ | ✅ | ✅ Native inference | | Schema Definition | .prisma file | TypeScript schema | Plain JS objects | | Learning Curve | Medium | Medium | Low |

Features

  • 🚀 Runtime-First — Define schema using plain JavaScript objects
  • 🔒 Native Type Inference — End-to-end TypeScript support without code generation
  • 🛠️ Zero Build Step — No CLI, no schema files, no generated clients
  • Lightweight Core — Minimal abstraction, ideal for serverless & edge
  • 📦 Modern — ESM-first, works with Node.js and Bun

Capabilities (v0.3.0)

  • CRUD: SELECT, INSERT, UPDATE, DELETE
  • Filtering: WHERE, OR, IN, LIKE, BETWEEN, IS NULL, comparison operators
  • ORDER BY: Single/multiple column sorting with ASC/DESC
  • LIMIT / OFFSET: Pagination support
  • Joins: INNER, LEFT, RIGHT, FULL JOIN with type inference
  • Transactions: Atomic operations with auto-rollback
  • Data Types: String, Number, Boolean, Date, JSON, UUID, Enum, Array
  • DDL: Auto-generate tables from schema with db.createTables()
  • Controllable RETURNING: Choose which columns to return from mutations
  • Shortcuts: .first() for single row, .count() for counting

When Should You Use PawQL?

Use PawQL if you:

  • Prefer runtime schema over DSL files
  • Want type inference without code generation
  • Need a lightweight alternative to heavy ORMs
  • Work in serverless or edge environments
  • Prefer clean, minimal APIs

Installation

npm install pawql pg

pg is a peer dependency for PostgreSQL connectivity.

Quick Start

import { createDB, PostgresAdapter } from 'pawql';

// 1. Define your schema using plain JS objects
const db = createDB({
  users: {
    id: { type: Number, primaryKey: true },
    name: String,
    email: { type: String, nullable: true },
    age: Number,
    isActive: { type: Boolean, default: true },
  },
  posts: {
    id: { type: Number, primaryKey: true },
    userId: Number,
    title: String,
    content: String,
  }
}, new PostgresAdapter({ connectionString: process.env.DATABASE_URL }));

// 2. Create tables (DDL)
await db.createTables();

// 3. Insert data
await db.query('users')
  .insert({ id: 1, name: 'Alice', email: '[email protected]', age: 28 })
  .execute();

// 4. Query with full type inference
const activeUsers = await db.query('users')
  .select('id', 'name')
  .where({ isActive: true })
  .orderBy('name', 'ASC')
  .limit(10)
  .execute();

// 5. Get a single row
const user = await db.query('users')
  .where({ id: 1 })
  .first(); // Returns single object or null

// 6. Count rows
const total = await db.query('users')
  .where({ isActive: true })
  .count(); // Returns number

Advanced Types

import { createDB, PostgresAdapter, uuid, json, enumType, arrayType } from 'pawql';

const db = createDB({
  events: {
    id: uuid,                                    // UUID
    name: String,                                // TEXT
    type: enumType('conference', 'meetup'),       // TEXT + CHECK constraint
    tags: arrayType(String),                     // TEXT[]
    details: json<{ location: string }>(),       // JSONB with TypeScript generic
    createdAt: Date,                             // TIMESTAMP
  }
}, adapter);

Documentation

For complete documentation, see the docs/ directory:

Philosophy

Most ORMs require a separate schema definition language or complex build steps. PawQL takes a different approach: your schema is just JavaScript. TypeScript infers everything at compile time, giving you full autocomplete and type checking without any extra tooling.

License

MIT — Ahmat Fauzi