import Fluent import SQLKit extension Database { public func withSQLConnection(_ closure: @escaping @Sendable (SQLDatabase) async throws -> T) async throws -> T { return try await self.withConnection { database in guard let connection = database as? SQLDatabase else { throw NoSQLDatabaseError (database: database) } return try await closure (connection) } } }