import 'package:niogu_app/core/database/app_database.dart';

AppDatabase? _db;

AppDatabase get database {
  if (_db == null) {
    throw Exception("Database belum diinisialisasi");
  }
  return _db!;
}

Future<void> setDatabase(AppDatabase db) async {
  _db = db;
}

Future<void> clearDatabase() async {
  await _db?.close();
  _db = null;
}