1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

General internal cleanups in the oo1 API.

FossilOrigin-Name: f9db664f756f3707afcb5dce87f6d946625848f27ea84337af68de72d4ad6c6b
This commit is contained in:
stephan
2022-10-02 00:09:40 +00:00
parent f064a3bbe4
commit 193ee11fe1
5 changed files with 84 additions and 68 deletions

View File

@ -785,7 +785,9 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
be released using restore().
This method always adjusts the given value to be a multiple
of 8 in order to keep alignment guarantees.
of 8 bytes because failing to do so can lead to incorrect
results when reading and writing 64-bit values from/to the WASM
heap.
*/
alloc: capi.wasm.exports.sqlite3_wasm_pstack_alloc
});
@ -809,6 +811,24 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
get: capi.wasm.exports.sqlite3_wasm_pstack_remaining
});
/**
An Error subclass specifically for reporting DB-level errors and
enabling clients to unambiguously identify such exceptions.
The C-level APIs never throw, but some of the higher-level
C-style APIs do and the object-oriented APIs use exceptions
exclusively to report errors.
*/
class SQLite3Error extends Error {
/**
Constructs this object with a message equal to all arguments
concatenated with a space between each one.
*/
constructor(...args){
super(args.join(' '));
this.name = 'SQLite3Error';
}
};
/** State for sqlite3_wasmfs_opfs_dir(). */
let __persistentDir = undefined;
@ -1059,6 +1079,7 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
/* The remainder of the API will be set up in later steps. */
const sqlite3 = {
WasmAllocError: WasmAllocError,
SQLite3Error: SQLite3Error,
capi,
config,
/**