import 'package:floor/floor.dart';

import '../entity/group.dart';

@dao
abstract class GroupDao {
  @Query('Select * from groups')
  Future<List<Group>> findAllGroups();

  @Query('Select * from groups where id = :id')
  Future<Group?> findGroupById(int id);

  @insert
  Future<void> insertGroup(Group group);

  @update
  Future<void> updateGroup(Group grouup);

  @delete
  Future<void> deleteGroup(Group group);

  @Query('Select COUNT(*) from groups')
  Future<int?> countGroups();
}
