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

Function openFlowDBForWorkdir

internal/app/workdir.go:41–53  ·  view source on GitHub ↗

openFlowDBForWorkdir opens the flow DB and returns (db, rc). On error, it prints and returns a non-nil error rc.

()

Source from the content-addressed store, hash-verified

39// openFlowDBForWorkdir opens the flow DB and returns (db, rc). On error, it
40// prints and returns a non-nil error rc.
41func openFlowDBForWorkdir() (*sql.DB, int) {
42 dbPath, err := flowDBPath()
43 if err != nil {
44 fmt.Fprintf(os.Stderr, "error: %v\n", err)
45 return nil, 1
46 }
47 db, err := flowdb.OpenDB(dbPath)
48 if err != nil {
49 fmt.Fprintf(os.Stderr, "error: open db: %v\n", err)
50 return nil, 1
51 }
52 return db, 0
53}
54
55// cmdWorkdirList prints all registered workdirs sorted by last_used_at
56// descending (NULLs last). Each row is rendered across two output lines

Callers 4

cmdWorkdirListFunction · 0.85
cmdWorkdirAddFunction · 0.85
cmdWorkdirRemoveFunction · 0.85
cmdWorkdirScanFunction · 0.85

Calls 2

OpenDBFunction · 0.92
flowDBPathFunction · 0.85

Tested by

no test coverage detected