Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, StoreError>

Source

pub fn open_in_memory() -> Result<Self, StoreError>

Source

pub fn upsert_execution(&self, rec: &ExecutionRecord) -> Result<(), StoreError>

Source

pub fn upsert_step(&self, rec: &ExecutionStepRecord) -> Result<(), StoreError>

Source

pub fn record_interception( &self, rec: &InterceptionRecord, ) -> Result<(), StoreError>

Source

pub fn record_ai_audit(&self, rec: &AiAuditRecord) -> Result<(), StoreError>

Append one AI audit event. Insert-only: the trail is written as part of the execution cycle and never updated after the fact.

Source

pub fn list_ai_audit( &self, execution_id: &str, ) -> Result<Vec<AiAuditRecord>, StoreError>

The AI audit trail for one execution, in insertion order.

Source

pub fn load_memory(&self) -> Result<HashMap<String, Value>, StoreError>

Load the persisted working-memory map (durable agent memory, roadmap E1). One row per {{memory.<key>}} entry; the value is JSON. Unparseable rows are skipped rather than failing the whole load.

Source

pub fn save_memory( &self, map: &HashMap<String, Value>, ) -> Result<(), StoreError>

Replace the persisted working memory with a full snapshot of map.

Source

pub fn clear_memory(&self) -> Result<(), StoreError>

Clear all persisted working memory.

Source

pub fn list_executions( &self, limit: usize, ) -> Result<Vec<ExecutionRecord>, StoreError>

Source

pub fn get_execution( &self, execution_id: &str, ) -> Result<Option<(ExecutionRecord, Vec<ExecutionStepRecord>, Vec<InterceptionRecord>)>, StoreError>

Source

pub fn list_runs(&self, limit: usize) -> Result<Vec<RunSummary>, StoreError>

Run summaries for list views, newest first - each with its monotonic run number (rowid) and the first failed node (for a failed @ <node> label).

Source

pub fn list_template_collections( &self, ) -> Result<Vec<TemplateCollectionRecord>, StoreError>

Source

pub fn get_template_collection( &self, slug: &str, ) -> Result<Option<TemplateCollectionRecord>, StoreError>

Source

pub fn upsert_template_collection( &self, slug: &str, name: &str, is_system: bool, ) -> Result<TemplateCollectionRecord, StoreError>

Insert if absent, otherwise update name + updated_at. is_system is set only on first insert - a subsequent upsert with is_system = false does NOT downgrade an existing system row. This makes the boot-time ensure_default idempotent without racing user renames.

Source

pub fn rename_template_collection( &self, slug: &str, new_name: &str, ) -> Result<TemplateCollectionRecord, StoreError>

Source

pub fn delete_template_collection(&self, slug: &str) -> Result<(), StoreError>

Refuses on is_system = true and on any extant membership row pointing at the collection. Caller is expected to move templates out (set their membership to another collection, or delete them) first.

Source

pub fn list_template_memberships( &self, ) -> Result<Vec<TemplateMembershipRow>, StoreError>

Source

pub fn get_template_membership( &self, template_slug: &str, ) -> Result<Option<TemplateMembershipRow>, StoreError>

Source

pub fn upsert_template_membership( &self, row: &TemplateMembershipRow, ) -> Result<(), StoreError>

Source

pub fn delete_template_membership( &self, template_slug: &str, ) -> Result<(), StoreError>

Source

pub fn get_flow_workspace( &self, flow_id: &str, ) -> Result<Option<String>, StoreError>

The per-flow workspace override, keyed by FlowGraph.id. None when the flow uses the edition default. Local machine state - never in the flow file.

Source

pub fn set_flow_workspace( &self, flow_id: &str, path: &str, ) -> Result<(), StoreError>

Source

pub fn clear_flow_workspace(&self, flow_id: &str) -> Result<(), StoreError>

Source

pub fn list_node_library_rows(&self) -> Result<Vec<NodeLibraryRow>, StoreError>

Source

pub fn get_node_library_row( &self, slug: &str, ) -> Result<Option<NodeLibraryRow>, StoreError>

Source

pub fn upsert_node_library_row( &self, row: &NodeLibraryRow, ) -> Result<NodeLibraryRow, StoreError>

Insert if absent, else update version + installed_at.

Source

pub fn delete_node_library_row(&self, slug: &str) -> Result<(), StoreError>

Source

pub fn upsert_schedule(&self, rec: &ScheduleRecord) -> Result<(), StoreError>

Insert or replace a flow’s schedule (keyed by template_slug). created_at is preserved on update.

Source

pub fn get_schedule( &self, template_slug: &str, ) -> Result<Option<ScheduleRecord>, StoreError>

Source

pub fn list_schedules(&self) -> Result<Vec<ScheduleRecord>, StoreError>

Source

pub fn list_due_schedules( &self, now: DateTime<Utc>, ) -> Result<Vec<ScheduleRecord>, StoreError>

Enabled schedules whose next_run_at is at or before now - the rows the background scheduler should fire on this tick.

Source

pub fn mark_schedule_run( &self, template_slug: &str, last_run_at: DateTime<Utc>, next_run_at: Option<DateTime<Utc>>, last_status: &str, ) -> Result<(), StoreError>

Advance a schedule’s timer on a fire: set last_run_at, the recomputed next_run_at, and bump the run counter.

Source

pub fn advance_schedule_without_run( &self, template_slug: &str, at: DateTime<Utc>, next_run_at: Option<DateTime<Utc>>, last_status: &str, ) -> Result<(), StoreError>

Source

pub fn set_schedule_enabled( &self, template_slug: &str, enabled: bool, next_run_at: Option<DateTime<Utc>>, ) -> Result<(), StoreError>

Source

pub fn migrate_schedule( &self, old_slug: &str, new_slug: &str, collection_slug: &str, flow_name: &str, ) -> Result<(), StoreError>

Source

pub fn delete_schedule(&self, template_slug: &str) -> Result<(), StoreError>

Trait Implementations§

Source§

impl Clone for Store

Source§

fn clone(&self) -> Store

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

§

impl !UnwindSafe for Store

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.