openDatabase method

Future<Database> openDatabase(
  1. String path,
  2. {int version,
  3. OnVersionChangedFunction onVersionChanged,
  4. DatabaseMode mode,
  5. SembastCodec codec}

Open a new or existing database.

path is the location of the database.

version is the version expected, if not null and if the existing version is different, onVersionChanged is called. When a database is created, its default version is 1.

mode is DatabaseMode.defaultMode by default.

A custom codec can be used to load/save a record, allowing for user encryption.

Custom settings can be specified.


Future<Database> openDatabase(String path,
    {int version,
    OnVersionChangedFunction onVersionChanged,
    DatabaseMode mode,
    SembastCodec codec});