WebDatabase constructor

WebDatabase(
  1. String name, {
  2. bool logStatements = false,
  3. CreateWebDatabase? initializer,
  4. WebSetup? setup,
  5. bool readIntsAsBigInt = false,
})

A database executor that works on the web.

name can be used to identify multiple databases. The optional initializer can be used to initialize the database if it doesn't exist.

The optional setup function can be used to perform a setup just after the database is opened, before drift is fully ready. This can be used to add custom user-defined sql functions or to provide encryption keys in SQLCipher implementations. Please note: With the current web implementation, the database is closed and re-opened whenever it is stored (i.e. after every transaction or insert/update/delete outside of transactions). The setup parameter will also be invoked whenever the database is re-opened.

Implementation

WebDatabase(
  String name, {
  bool logStatements = false,
  CreateWebDatabase? initializer,
  WebSetup? setup,
  this.readIntsAsBigInt = false,
}) : super(
          _WebDelegate(
              DriftWebStorage(name), initializer, setup, readIntsAsBigInt),
          logStatements: logStatements,
          isSequential: true);