MCPcopy Index your code
hub / github.com/sourcegraph/checkup / Fetch

Method Fetch

storage/sql/sql.go:136–154  ·  view source on GitHub ↗

Fetch fetches results of the check with given name.

(name string)

Source from the content-addressed store, hash-verified

134
135// Fetch fetches results of the check with given name.
136func (sql Storage) Fetch(name string) ([]types.Result, error) {
137 db, err := sql.dbConnect()
138 if err != nil {
139 return nil, err
140 }
141 defer db.Close()
142
143 var checkResult []byte
144 var results []types.Result
145
146 err = db.Get(&checkResult, `SELECT results FROM "checks" WHERE name=$1 LIMIT 1`, name)
147 if err != nil {
148 return nil, err
149 }
150 if err = json.Unmarshal(checkResult, &results); err != nil {
151 return nil, err
152 }
153 return results, nil
154}
155
156// Store stores results in the database.
157func (sql Storage) Store(results []types.Result) error {

Callers 1

TestSQLFunction · 0.95

Implementers 5

fakecheckup_test.go
Storagestorage/sql/sql.go
Storagestorage/s3/s3.go
Storagestorage/github/github.go
Storagestorage/fs/fs.go

Calls 1

dbConnectMethod · 0.95

Tested by 1

TestSQLFunction · 0.76