import HummingbirdFluent import Logging @testable import Persistence /// Runs the body against a migrated, seeded in-memory database, shutting the pool down after — even on failure, or the pool asserts on `deinit`. func withDatabase( _ body: (Fluent) async throws -> Void ) async throws { let fluent = try Service( driver: .inMemory, logger: Logger(label: "test") )() defer { try? await fluent.shutdown() } await PrepareDB()(for: fluent) try await fluent.migrate() try await body(fluent) }