Skip to main content

Store

Trait Store 

Source
pub trait Store:
    RunStore
    + UserStore
    + ApiKeyStore
    + SecretStore
    + AuditLogStore { }
Expand description

Unified storage abstraction combining all store capabilities.

Implementors provide runs, steps, users, API keys, and secrets through a single type. Pick one backend (in-memory or PostgreSQL) and it handles everything.

Both InMemoryStore and PostgresStore implement this trait.

§Examples

use std::collections::HashMap;
use std::sync::Arc;
use ironflow_store::prelude::*;

let store: Arc<dyn Store> = Arc::new(InMemoryStore::new());

// All capabilities through one reference
let _run = store.create_run(NewRun {
    workflow_name: "deploy".to_string(),
    trigger: TriggerKind::Manual,
    payload: serde_json::json!({}),
    max_retries: 3,
    handler_version: None,
    labels: HashMap::new(),
    scheduled_at: None,
}).await?;
let _users = store.count_users().await?;

Implementors§