WorkflowDao.swift 16 lignes · 514 octets
import Foundation

/// Port of the Room `WorkflowDao`.
protocol WorkflowDao {
    /// INSERT OR REPLACE INTO workflows.
    func upsert(_ entity: WorkflowEntity) async throws

    /// SELECT * FROM workflows WHERE serverId = :serverId
    func getByServerId(_ serverId: String) async throws -> WorkflowEntity?

    /// DELETE FROM workflows WHERE serverId = :serverId
    func deleteByServerId(_ serverId: String) async throws

    /// SELECT * FROM workflows
    func listAll() async throws -> [WorkflowEntity]
}