Skip to content

SqliteActionRepository

ClassAssetInventoryAssetInventory.Editor
[Serializable]
public sealed class SqliteActionRepository

Implementation of IActionRepository that uses AssetInventory’s SQLite database via CustomAction and CustomActionStep tables.

public List<ActionDefinition> GetAllActions()

Gets all action definitions.

Returns

System.Collections.Generic.List{Automator.ActionDefinition} — List of all actions

public ActionDefinition GetAction(int id)

Gets a single action by ID.

Parameters

Name Type Description
id System.Int32 The action ID

Returns

Automator.ActionDefinition — The action, or null if not found

public ActionDefinition GetActionByName(string name)

Gets a single action by name.

Parameters

Name Type Description
name System.String The action name

Returns

Automator.ActionDefinition — The action, or null if not found

public ActionDefinition SaveAction(ActionDefinition action)

Saves an action (insert or update).

Parameters

Name Type Description
action Automator.ActionDefinition The action to save

Returns

Automator.ActionDefinition — The saved action with updated ID if inserted

public void DeleteAction(int id)

Deletes an action and its steps.

Parameters

Name Type Description
id System.Int32 The action ID to delete
public List<ActionStepDefinition> GetSteps(int actionId)

Gets all steps for an action.

Parameters

Name Type Description
actionId System.Int32 The action ID

Returns

System.Collections.Generic.List{Automator.ActionStepDefinition} — List of steps ordered by OrderIndex

public ActionStepDefinition SaveStep(ActionStepDefinition step)

Saves a step (insert or update).

Parameters

Name Type Description
step Automator.ActionStepDefinition The step to save

Returns

Automator.ActionStepDefinition — The saved step with updated ID if inserted

public void DeleteStep(int id)

Deletes a step.

Parameters

Name Type Description
id System.Int32 The step ID to delete
public void DeleteStepsExcept(int actionId, List<int> keepStepIds)

Deletes all steps for an action that are not in the given list of IDs.

Parameters

Name Type Description
actionId System.Int32 The action ID
keepStepIds System.Collections.Generic.List{System.Int32} Step IDs to keep
public void Save()

Persists any pending changes (for file-based repositories).