Astro: @astrojs/db@0.21.0 Release

Release date:
April 28, 2026
Previous version:
@astrojs/db@0.20.1 (released March 18, 2026)
Magnitude:
19,067 Diff Delta
Contributors:
26 total committers
Data confidence:
Commits:

197 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored April 1, 2026
Authored April 16, 2026
Authored March 26, 2026
Authored April 7, 2026
Authored March 19, 2026
Authored March 27, 2026
Authored April 6, 2026
Authored March 27, 2026
Authored April 22, 2026
Authored March 19, 2026
Authored April 8, 2026
Authored April 14, 2026
Authored April 8, 2026
Authored April 15, 2026

Top Contributors in @astrojs/db@0.21.0

ematipico
matthewp
ocavue
astrobot-houston
ljharb
florian-lefebvre
seroperson
renovate-bot
Princesseuh
merlinnot

Directory Browser for @astrojs/db@0.21.0

All files are compared to previous version, @astrojs/db@0.20.1. Click here to browse diffs between other versions.

Loading File Browser...

Release Notes Published

Minor Changes

  • #16289 5d580c0 Thanks @maxmalkin! - Adds a new getDbError() helper exported from astro:db. It walks the error .cause chain and returns the underlying LibsqlError, or undefined if the error did not originate from libSQL. This is needed because drizzle-orm 0.44+ wraps query errors in a DrizzleQueryError whose .cause is the real LibsqlError.

    Upgrading

    Code that reads .code or .message after catching a database error should migrate from isDbError() to getDbError():

    // Before
    import { isDbError } from 'astro:db';
    try {
      await db.insert(MyTable).values({ ... });
    } catch (e) {
      if (isDbError(e)) {
        console.error(e.code, e.message);
      }
    }
    
    // After
    import { getDbError } from 'astro:db';
    try {
      await db.insert(MyTable).values({ ... });
    } catch (e) {
      const dbError = getDbError(e);
      if (dbError) {
        console.error(dbError.code, dbError.message);
      }
    }
    

    isDbError() is still exported and still returns true for wrapped errors, but its return type is now boolean instead of the err is LibsqlError type predicate. Code that relied on the narrowing to access .code or .message directly will now produce a TypeScript error pointing you to getDbError().

Patch Changes

  • #16289 5d580c0 Thanks @maxmalkin! - Fixes a SQL injection vulnerability by updating drizzle-orm to ^0.45.2, patching GHSA-gpj5-g38j-94v9 (CVE-2026-39356).