Skip to content

Open an in-memory database on the web #117

@xvrh

Description

@xvrh

Can we open an in-memory database on the web?

Would be great to be able to write:

  final db = SqliteDatabase(
    path: ':memory:',
    options: SqliteOptions(webSqliteOptions: WebSqliteOptions.defaults()),

Currently it seems to create an IndexedDB named :memory:

Image


I also tried something like

final sqlite = await WasmSqlite3.loadFromUrl(
      Uri.parse('sqlite3.wasm'));
sqlite.registerVirtualFileSystem(InMemoryFileSystem(), makeDefault: true);
var db = sqlite.openInMemory();

But this gives a CommonDatabase and I don't know how to convert it to a SqliteDatabase.

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions