open method

Future<Database> open(
  1. int version, {
  2. required List<Sqflite> tableList,
})

Implementation

Future<Database> open(final int version,
    {required final List<e.Sqflite> tableList}) async {
  String? string = await _sqfliteFactory.name.value;
  if (string == null) {
    await _sqfliteFactory.name.setValue(_randomBusiness.generateRandomString(
        _randomBusiness.generateRandomInt(minimum: 1, maximum: 8)));
  }
  await _sqfliteFactory.version.setValue(version);
  string = await _sqfliteFactory.password.value;
  if (string == null) {
    await _sqfliteFactory.password.setValue(
        _randomBusiness.generateRandomString(
            _randomBusiness.generateRandomInt(minimum: 8, maximum: 128)));
  }
  string = await _sqfliteFactory.password.value;
  if (kDebugMode) {
    print(string);
  }
  return await openDatabase(
      join(await getDatabasesPath(), await _sqfliteFactory.name.value),
      version: await _sqfliteFactory.version.value,
      onUpgrade: (final Database database, _, __) =>
          _onUpgrade(database, tableList: tableList),
      password: string);
}