Implement backup
in node:sqlite
and add ArrayBuffer
support for database paths and backup targets
#29439
Labels
node:sqlite
Issues related to the `node:sqlite` module
Uh oh!
There was an error while loading. Please reload this page.
The
node:sqlite
module in Deno currently lacks thebackup
function, which is part of thenode:sqlite
API in Node.js (as seen in the Node.js documentation athttps://nodejs.org/api/sqlite.html#sqlitebackupsourcedb-path-options
). This absence prevents users from performing direct database backups programmatically using thenode:sqlite
compatibility layer.Furthermore, when working with in-memory database operations or managing database content directly in memory (e.g., for custom serialization, encryption, or temporary processing), the
DatabaseSync
constructor'spath
argument only supportstring
.Describe the solution you'd like
I would like to request two key enhancements for the
node:sqlite
module in Deno:Implement
backup
function: Please implement thebackup
function as it exists in Node.js, accessible viaimport { backup } from "node:sqlite";
. This function is essential for creating database backups.Add
ArrayBuffer
support for database paths and backup targets:DatabaseSync
constructor: Allow thepath
argument to accept anArrayBuffer
. This would enable direct instantiation of an in-memory database from anArrayBuffer
.backup
function: Allow thepath
argument (the backup target) to accept anArrayBuffer
. This would enable writing the database backup directly into a providedArrayBuffer
.Describe alternatives you've considered
Currently, there is no direct alternative for
sqlite.backup
within Deno'snode:sqlite
module, requiring users to resort to wasm sqlite implementations or manual file operations for backups.The text was updated successfully, but these errors were encountered: