You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sqlite.backup() TypeScript definition incorrectly returns Promise<void> instead of Promise<number> #59597
The backup() function in Node.js SQLite bindings currently has its TypeScript type defined as returning Promise<void>. However, the actual implementation returns an Promise<number> representing the number of pages backed up.
import{backup,DatabaseSync}from'node:sqlite';constsourceDb=newDatabaseSync('source.db');consttotalPagesTransferred=awaitbackup(sourceDb,'backup.db',{rate: 1,// Copy one page at a time.progress: ({ totalPages, remainingPages })=>{console.log('Backup in progress',{ totalPages, remainingPages });},});console.log('Backup completed',totalPagesTransferred);
Activity
Renegade334 commentedon Aug 23, 2025
Issues with @types packages should be logged via https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package.
edilson258 commentedon Aug 23, 2025
Okay, but i do not know if is the types wrong or is the implementation
Renegade334 commentedon Aug 23, 2025
It's just not completely documented on the Node.js side, which hopefully #59598 addresses.
geeksilva97 commentedon Aug 28, 2025
PR has landed. Can this issue be closed, @Renegade334 ?
Renegade334 commentedon Aug 28, 2025
The @types/node side of things doesn't affect this repo, so I'd say so.