| 123456789101112131415161718192021222324 |
- import 'package:drift/drift.dart';
- import '../database.dart';
- class TabelleDao {
- final AppDatabase db;
- TabelleDao(this.db);
- Future<List<Tabella>> getByTipo(String tipo) {
- return (db.select(db.tabelle)..where((t) => t.tipoTabella.equals(tipo)))
- .get();
- }
- Future<Tabella?> getByCode(String tipo, String code) {
- return (db.select(db.tabelle)
- ..where(
- (t) => t.tipoTabella.equals(tipo) & t.codTabella.equals(code)))
- .getSingleOrNull();
- }
- Future<Tabella?> findById(int id) {
- return (db.select(db.tabelle)..where((t) => t.idTabella.equals(id)))
- .getSingleOrNull();
- }
- }
|