load static method

Future<WasmSqlite3> load(
  1. Uint8List source
)

Loads a web version of the sqlite3 libraries.

source must be a byte buffer of a sqlite.wasm file prepared for this package. This file can be obtained at the releases for this package.

The environment can optionally be set to use a custom virtual file system. By default, all databases opened are stored in memory only (this includes databases opened with a path in open).

When the source is obtained through a HTTP request, consider directly using loadFromUrl as that method is more efficient.

Implementation

static Future<WasmSqlite3> load(Uint8List source) {
  final headers = JSObject()..['content-type'] = 'application/wasm'.toJS;

  final fakeResponse = web.Response(
    source.toJS,
    web.ResponseInit(headers: headers),
  );

  return _load(fakeResponse);
}