database

package
v0.0.0-...-3a5ecfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDB

func CloseDB() error

CloseDB closes the database connection

func CompleteActionExecution

func CompleteActionExecution(id int64, status string, errorMsg *string, output *string, duration time.Duration) error

CompleteActionExecution updates an action execution as completed

func CompleteWorkflowExecution

func CompleteWorkflowExecution(id int64, status string, errorMsg *string, duration time.Duration) error

CompleteWorkflowExecution updates a workflow execution as completed

func GetDB

func GetDB() *sql.DB

GetDB returns the database instance (for testing)

func InitDB

func InitDB(dbPath string) error

InitDB initializes the SQLite database

func StartActionExecution

func StartActionExecution(workflowExecID int64, actionName, actionType string) (int64, error)

StartActionExecution creates a new action execution record

func StartWorkflowExecution

func StartWorkflowExecution(workflowName, triggerType string) (int64, error)

StartWorkflowExecution creates a new workflow execution record

Types

type ActionExecution

type ActionExecution struct {
	ID                  int64
	WorkflowExecutionID int64
	ActionName          string
	ActionType          string
	StartedAt           time.Time
	CompletedAt         *time.Time
	Status              string // running, success, failed
	Error               *string
	DurationMs          *int64
	Output              *string
}

ActionExecution represents an action execution record

type WorkflowExecution

type WorkflowExecution struct {
	ID           int64
	WorkflowName string
	StartedAt    time.Time
	CompletedAt  *time.Time
	Status       string // running, success, failed
	Error        *string
	DurationMs   *int64
	TriggerType  string
}

WorkflowExecution represents a workflow execution record

func GetAllWorkflowHistory

func GetAllWorkflowHistory(limit int) ([]WorkflowExecution, error)

GetAllWorkflowHistory returns recent executions for all workflows

func GetFailedExecutions

func GetFailedExecutions(since time.Time, limit int) ([]WorkflowExecution, error)

GetFailedExecutions returns recent failed workflow executions

func GetWorkflowHistory

func GetWorkflowHistory(workflowName string, limit int) ([]WorkflowExecution, error)

GetWorkflowHistory returns recent workflow executions

type WorkflowStats

type WorkflowStats struct {
	WorkflowName    string
	TotalExecutions int
	SuccessCount    int
	FailedCount     int
	SuccessRate     float64
	AvgDurationMs   float64
}

GetWorkflowStats returns statistics for a workflow

func GetWorkflowStats

func GetWorkflowStats(workflowName string, since time.Time) (*WorkflowStats, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL