diff options
author | stephan <stephan@noemail.net> | 2022-09-26 13:55:10 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-09-26 13:55:10 +0000 |
commit | 278d3faf1ffa6bbd14253865edba3e81631d0cb5 (patch) | |
tree | fe54c334cfee9001d5f3d1d7a05cb2d0d31f8735 /ext/wasm/api/sqlite3-api-oo1.js | |
parent | 1f095d482d1803deb9fcb60449e9ca1223018d73 (diff) | |
download | sqlite-278d3faf1ffa6bbd14253865edba3e81631d0cb5.tar.gz sqlite-278d3faf1ffa6bbd14253865edba3e81631d0cb5.zip |
Fiddle: replace db export routine with a C-side one which works for both Emscripten FS-hosted and OPFS-hosted db files. Minor code-adjacent cleanups.
FossilOrigin-Name: 3579a8d6f1f6cd3cd8aad9949536870c5fe7bae8c1778f700dd85d763e266b94
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.js')
-rw-r--r-- | ext/wasm/api/sqlite3-api-oo1.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js index 25ca34dda..e0f812baa 100644 --- a/ext/wasm/api/sqlite3-api-oo1.js +++ b/ext/wasm/api/sqlite3-api-oo1.js @@ -1025,51 +1025,6 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"); throw e; } - }, - - /** - This function currently does nothing and always throws. It - WILL BE REMOVED pending other refactoring, to eliminate a hard - dependency on Emscripten. This feature will be moved into a - higher-level API or a runtime-configurable feature. - - That said, what its replacement should eventually do is... - - Exports a copy of this db's file as a Uint8Array and - returns it. It is technically not legal to call this while - any prepared statement are currently active because, - depending on the platform, it might not be legal to read - the db while a statement is locking it. Throws if this db - is not open or has any opened statements. - - The resulting buffer can be passed to this class's - constructor to restore the DB. - - Maintenance reminder: the corresponding sql.js impl of this - feature closes the current db, finalizing any active - statements and (seemingly unnecessarily) destroys any UDFs, - copies the file, and then re-opens it (without restoring - the UDFs). Those gymnastics are not necessary on the tested - platform but might be necessary on others. Because of that - eventuality, this interface currently enforces that no - statements are active when this is run. It will throw if - any are. - */ - exportBinaryImage: function(){ - toss3("exportBinaryImage() is slated for removal for portability reasons."); - /*********************** - The following is currently kept only for reference when - porting to some other layer, noting that we may well not be - able to implement this, at this level, when using the OPFS - VFS because of its exclusive locking policy. - - affirmDbOpen(this); - if(this.openStatementCount()>0){ - toss3("Cannot export with prepared statements active!", - "finalize() all statements and try again."); - } - return MODCFG.FS.readFile(this.filename, {encoding:"binary"}); - ***********************/ } }/*DB.prototype*/; |