nc-photos/app/lib/use_case/compat/v46.dart

23 lines
687 B
Dart
Raw Normal View History

2022-07-17 21:32:04 +02:00
import 'package:logging/logging.dart';
2023-02-20 15:21:35 +01:00
import 'package:nc_photos/entity/sqlite/database.dart' as sql;
2022-07-17 21:32:04 +02:00
import 'package:nc_photos/pref.dart';
2022-12-16 16:01:04 +01:00
import 'package:np_codegen/np_codegen.dart';
2022-07-17 21:32:04 +02:00
2022-12-16 16:01:04 +01:00
part 'v46.g.dart';
@npLog
2022-07-17 21:32:04 +02:00
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);
}
});
}
2022-12-20 17:49:14 +01:00
static final _log = _$CompatV46NpLog.log;
2022-07-17 21:32:04 +02:00
}