mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 14:56:20 +01:00
19 lines
701 B
Dart
19 lines
701 B
Dart
import 'package:logging/logging.dart';
|
|
import 'package:nc_photos/entity/sqlite_table.dart' as sql;
|
|
import 'package:nc_photos/entity/sqlite_table_extension.dart' as sql;
|
|
import 'package:nc_photos/pref.dart';
|
|
|
|
class CompatV46 {
|
|
static Future<void> insertDbAccounts(Pref pref, sql.SqliteDb sqliteDb) async {
|
|
_log.info("[insertDbAccounts] Insert current accounts to Sqlite database");
|
|
await sqliteDb.use((db) async {
|
|
final accounts = pref.getAccounts3Or([]);
|
|
for (final a in accounts) {
|
|
_log.info("[insertDbAccounts] Insert account to Sqlite db: $a");
|
|
await db.insertAccountOf(a);
|
|
}
|
|
});
|
|
}
|
|
|
|
static final _log = Logger("use_case.compat.v46.CompatV46");
|
|
}
|