#16964b048826 Thanks @Princesseuh! - Deprecates the @astrojs/db integration. We no longer have the bandwidth to maintain this package, and we recommend that users directly use the database client of their choice (Drizzle, Kysely, etc.) in their Astro projects instead.
#162895d580c0 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) {
constdbError=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
#162895d580c0 Thanks @maxmalkin! - Fixes a SQL injection vulnerability by updating drizzle-orm to ^0.45.2, patching GHSA-gpj5-g38j-94v9 (CVE-2026-39356).
#15069d14dfc2 Thanks @webstackdev! - Adds a --db-app-token CLI flag to astro db commands execute, push, query, and verify
The new Astro DB CLI flags allow you to provide a remote database app token directly instead of ASTRO_DB_APP_TOKEN. This ensures that no untrusted code (e.g. CI / CD workflows) has access to the secret that is only needed by the astro db commands.
The following command can be used to safely push database configuration changes to your project database:
#14204d71448e Thanks @Adammatthiesen! - Adds a new libSQL web driver to support environments that require a non-Node.js libSQL client such as Cloudflare or Deno. Also adds a new mode configuration option to allow you to set your client connection type: node (default) or web.
The default db node driver mode is identical to the previous AstroDB functionality. No changes have been made to how AstroDB works in Node.js environments, and this is still the integrationβs default behavior. If you are currently using AstroDB, no changes to your project code are required and setting a mode is not required.
However, if you have previously been unable to use AstroDB because you required a non-Node.js libSQL client, you can now install and configure the libSQL web driver by setting mode: 'web' in your db configuration: