@livestore/wa-sqlite 1.0.1-dev.19 → 1.0.1-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sqlite-api.js +2 -1
- package/src/types/index.d.ts +2 -0
package/package.json
CHANGED
package/src/sqlite-api.js
CHANGED
|
@@ -289,7 +289,8 @@ export function Factory(Module) {
|
|
|
289
289
|
verifyDatabase(source);
|
|
290
290
|
const backup = fInit(dest, destName, source, sourceName);
|
|
291
291
|
if (backup === 0) {
|
|
292
|
-
|
|
292
|
+
const errMsg = Module.ccall('sqlite3_errmsg', 'string', ['number'], [dest]);
|
|
293
|
+
throw new SQLiteError(`backup failed: ${errMsg}`, SQLite.SQLITE_ERROR);
|
|
293
294
|
}
|
|
294
295
|
fStep(backup, -1);
|
|
295
296
|
return fFinish(backup);
|
package/src/types/index.d.ts
CHANGED
|
@@ -389,6 +389,8 @@ interface SQLiteAPI {
|
|
|
389
389
|
|
|
390
390
|
/**
|
|
391
391
|
* Combines the `backup_init`, `backup_step`, and `backup_finish` functions.
|
|
392
|
+
* destName/sourceName is usually "main" or "temp".
|
|
393
|
+
*
|
|
392
394
|
* @returns `SQLITE_OK` (throws exception on error)
|
|
393
395
|
*/
|
|
394
396
|
backup(pDest: number, zDestName: string, pSource: number, zSourceName: string): number;
|