Skip to content

v1.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 18 May 16:26
· 1 commit to main since this release

What's new

Bun native SQL for Postgres — no pg needed

The @joint-ops/hitlimit-bun postgres store now runs on Bun's built-in SQL client. No extra driver, no N-API, no bindings. Just pass a connection string and go.

import { postgresStore } from '@joint-ops/hitlimit-bun/stores/postgres'

// connection string — store manages the client
hitlimit({ store: postgresStore({ url: process.env.DATABASE_URL }) }, handler)

// or bring your own Bun.SQL instance
import { SQL } from 'bun'
const sql = new SQL(process.env.DATABASE_URL)
hitlimit({ store: postgresStore({ client: sql }) }, handler)

The old pg.Pool path still works but is now deprecated — url or client are preferred. pg is no longer a required peer dependency.


Install

# Node.js
npm install @joint-ops/hitlimit@1.5.0

# Bun
bun add @joint-ops/hitlimit-bun@1.5.0

What changed

@joint-ops/hitlimit-bun

  • New url option — pass a Postgres connection string, store owns the client
  • New client option — pass a caller-owned Bun.SQL instance
  • pool (pg.Pool) deprecated — still works, pg is now an optional peer dep only
  • Removed --external=pg from build — pg no longer required at runtime
  • Full driver-matrix test suite: all three connection modes covered

Docs

  • Full audit of all 51 pages — verified against source, fixed wrong types, broken links, and fabricated APIs throughout
  • npm READMEs for hitlimit, hitlimit-bun, and hitlimit-types fully rewritten — accurate, no comparisons, all 8 stores visible
  • Postgres store page updated with runtime-gated examples (Node / Bun)

Shoutout

Big thanks to @bobbymannino for raising #23 and clearly laying out the problem. This one's for you.


Full changelog: v1.4.0...v1.5.0