migrating...
This commit is contained in:
24
lib/daos/action_sets_dao.dart
Normal file
24
lib/daos/action_sets_dao.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:sendtrain/database/database.dart';
|
||||
|
||||
part 'action_sets_dao.g.dart';
|
||||
|
||||
@DriftAccessor(tables: [ActionSets])
|
||||
class ActionSetsDao extends DatabaseAccessor<AppDatabase>
|
||||
with _$ActionSetsDaoMixin {
|
||||
ActionSetsDao(super.db);
|
||||
|
||||
// Future<Session> find(int id) => (select(sessions)..where((session) => session.id.equals(id) )).getSingle();
|
||||
// Stream<Session> watchSession(int id) => (select(sessions)..where((session) => session.id.equals(id) )).watchSingle();
|
||||
// Future<List<Session>> all() => select(sessions).get();
|
||||
// Stream<List<Session>> watch() => select(sessions).watch();
|
||||
// Future createOrUpdate(SessionsCompanion session) => into(sessions).insertOnConflictUpdate(session);
|
||||
// Future replace(Session session) => update(sessions).replace(session);
|
||||
// Future remove(Session session) => delete(sessions).delete(session);
|
||||
|
||||
Future<List<ActionSet>> fromSession(Session session) async {
|
||||
return await (select(actionSets)
|
||||
..where((actionSet) => actionSet.sessionId.equals(session.id))..orderBy([(t) => OrderingTerm.asc(actionSets.position)]))
|
||||
.get();
|
||||
}
|
||||
}
|
10
lib/daos/action_sets_dao.g.dart
Normal file
10
lib/daos/action_sets_dao.g.dart
Normal file
@ -0,0 +1,10 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'action_sets_dao.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
mixin _$ActionSetsDaoMixin on DatabaseAccessor<AppDatabase> {
|
||||
$ActivitiesTable get activities => attachedDatabase.activities;
|
||||
$SessionsTable get sessions => attachedDatabase.sessions;
|
||||
$ActionSetsTable get actionSets => attachedDatabase.actionSets;
|
||||
}
|
@ -12,7 +12,7 @@ class ActionsDao extends DatabaseAccessor<AppDatabase> with _$ActionsDaoMixin {
|
||||
}
|
||||
|
||||
Future<Action> find(int id) async {
|
||||
return await (select(actions)..where((action) => action.id.equals(id) )).getSingle();
|
||||
return await (select(actions)..where((action) => action.id.equals(id))).getSingle();
|
||||
}
|
||||
|
||||
Future<List<Action>> fromActivity(Activity activity, Session session) async {
|
||||
|
Reference in New Issue
Block a user