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
Current state: package:sqlite3experimentally supports being compiled with dart2wasm. Unit tests exercising the bindings themselves all pass, but persistence is broken. There are additional caveats and todos to be aware of:
(fixed in upcoming Dart SDK release) dart2wasm doesn't seem to support Random.secure(), which we use for our VFS implementations. You can work around this issue by supplying your own non-secure Random() instance to VFS constructors, but please be aware that this may be a security risk. sqlite3 docs require that "The xRandomness() function attempts to return nBytes bytes of good-quality randomness into zOut", so I won't use the non-secure random instance as a default in this package.
When binding over web APIs returning JavaScript ArrayBuffers, we're converting them to Dart TypedData subclasses for convenience. This is not sound for dart2wasm, which copies the bytes instead of referencing the original buffer. This may just be hugely inefficient, but it can also cause deadlocks for OPFS and data corruption issues on other VFS implementations.
We're currently loading an additional wasm module for sqlite3 (sqlite3.wasm). Once the native assets feature is stable and supports WebAssembly, obviously we want to link the Dart application and sqlite3 into the same wasm file for easier deployments.
The text was updated successfully, but these errors were encountered:
Current state:
package:sqlite3
experimentally supports being compiled withdart2wasm
. Unit tests exercising the bindings themselves all pass, but persistence is broken. There are additional caveats and todos to be aware of:dart2wasm
doesn't seem to supportRandom.secure()
, which we use for our VFS implementations. You can work around this issue by supplying your own non-secureRandom()
instance to VFS constructors, but please be aware that this may be a security risk. sqlite3 docs require that "The xRandomness() function attempts to return nBytes bytes of good-quality randomness into zOut", so I won't use the non-secure random instance as a default in this package.TypedData
subclasses for convenience. This is not sound for dart2wasm, which copies the bytes instead of referencing the original buffer. This may just be hugely inefficient, but it can also cause deadlocks for OPFS and data corruption issues on other VFS implementations.sqlite3.wasm
). Once the native assets feature is stable and supports WebAssembly, obviously we want to link the Dart application and sqlite3 into the same wasm file for easier deployments.The text was updated successfully, but these errors were encountered: