import 'package:floor/floor.dart';
import 'package:skillcourt/entity/player.dart';

@dao
abstract class PlayerDao {
  @Query('Select * from players')
  Future<List<Player>> findAllPlayers();

  @Query('Select * from players where id = :id')
  Future<Player?> findPlayerById(int id);

  @insert
  Future<void> insertPlayer(Player player);

  @update
  Future<void> updatePlayer(Player player);

  @delete
  Future<void> deletePlayer(Player player);

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