MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TaskBySessionID

Function TaskBySessionID

internal/flowdb/db.go:757–763  ·  view source on GitHub ↗

TaskBySessionID returns the task bound to the given Claude session UUID, or sql.ErrNoRows if none. The partial unique index on tasks(session_id) WHERE session_id IS NOT NULL guarantees at most one row. Empty sid is treated as "no binding" and returns ErrNoRows without hitting the DB.

(db *sql.DB, sid string)

Source from the content-addressed store, hash-verified

755// one row. Empty sid is treated as "no binding" and returns ErrNoRows
756// without hitting the DB.
757func TaskBySessionID(db *sql.DB, sid string) (*Task, error) {
758 if sid == "" {
759 return nil, sql.ErrNoRows
760 }
761 row := db.QueryRow("SELECT "+TaskCols+" FROM tasks WHERE session_id = ? LIMIT 1", sid)
762 return ScanTask(row)
763}
764
765func ListTasks(db *sql.DB, filter TaskFilter) ([]*Task, error) {
766 var where []string

Callers 4

currentSessionTaskFunction · 0.92
cmdDoHereFunction · 0.92
cmdRunPlaybookFunction · 0.92
lookupBoundTaskFunction · 0.92

Calls 1

ScanTaskFunction · 0.85

Tested by

no test coverage detected