News

Bunny.net releases official fetch-based client for Bunny Database

Bunny.net publishes @bunny.net/database-client, a zero-dependency SQL library for querying Bunny Database from Edge Scripting, Node, Deno and Bun.

UptimeMag editorial team · 2 September 2026 · 2 min read

Bunny.net rilascia il client ufficiale per Bunny Database basato su fetch

Bunny.net released on 2 September 2026 via its official blog a new library for querying Bunny Database, the SQLite-compatible database service launched by the provider in public preview in February. The package is called @bunny.net/database-client and targets a specific audience: those writing code for Bunny Edge Scripting, as well as those using Deno, Bun or Node without wanting to add runtime dependencies.

The technical feature that distinguishes the library from the rest of the market offering is straightforward to verify: it distributes globally, queries via HTTP and scales reads with low latency, and the client itself relies only on fetch, with no external libraries to install or update.

Usage

By calling connect() without arguments, the client reads the BUNNY_DATABASE_URL and BUNNY_DATABASE_AUTH_TOKEN variables already set by bunny db link and Edge Scripting. Queries are passed via prepare().bind().all() or .first(), whilst writes use run(), which returns metadata such as rowsAffected and lastInsertRowid. For transactions in a single HTTP call there is batch(): if any statement fails, the entire transaction rolls back and the method throws the error of the failing statement, leaving no partial states. For initial schema there remains exec(), designed for multi-statement scripts with no parameters or returned rows; for schemas intended to change over time, the documentation refers to the bunny db migrations create, apply and list commands, still labelled as experimental.

On the error front, every exception arrives as DatabaseError with the original SQLite code attached (for example SQLITE_CONSTRAINT), avoiding string comparison against messages; network failures before query execution are also wrapped with NETWORK, TIMEOUT and ABORTED codes.

Token security

Bunny.net reiterates that the client must only be used server-side: the database token authorizes the entire connection, not individual queries, so it should never be exposed in the browser. To limit damage in case of token leakage, the CLI allows creating tokens with restricted permissions, for example bunny db tokens create --read-only --expiry 30d.

Working examples are available for Bun, Node, Hono, Edge Scripting, Next.js, Astro and SvelteKit. The package is installed with npm install @bunny.net/database-client, or equivalent pnpm or bun add commands; the project welcomes contributions on GitHub and discussion on Discord, according to Bunny.net's blog post.

Written with the help of artificial intelligence and checked by the editors (EU AI Act, art. 50).