Обновлен проект. Добавлена БД
This commit is contained in:
22
lib/database/dao/collections_dao.dart
Normal file
22
lib/database/dao/collections_dao.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
// Package imports:
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:remever/database/database.dart';
|
||||
import 'package:remever/database/tables.dart';
|
||||
|
||||
part 'collections_dao.g.dart';
|
||||
|
||||
@DriftAccessor(tables: <Type>[Collections])
|
||||
class CollectionsDao extends DatabaseAccessor<AppDatabase>
|
||||
with _$CollectionsDaoMixin {
|
||||
///
|
||||
/// Репозиторий для работы с коллекциями
|
||||
///
|
||||
CollectionsDao(super.attachedDatabase);
|
||||
|
||||
///
|
||||
/// Получение коллекций из базы данных
|
||||
///
|
||||
Stream<List<Collection>> getCollections() {
|
||||
return db.managers.collections.watch();
|
||||
}
|
||||
}
|
||||
8
lib/database/dao/collections_dao.g.dart
Normal file
8
lib/database/dao/collections_dao.g.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'collections_dao.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
mixin _$CollectionsDaoMixin on DatabaseAccessor<AppDatabase> {
|
||||
$CollectionsTable get collections => attachedDatabase.collections;
|
||||
}
|
||||
Reference in New Issue
Block a user