MCPcopy
hub / github.com/rqlite/rqlite / mustQueryDB

Function mustQueryDB

snapshot/store_test.go:1485–1497  ·  view source on GitHub ↗
(t *testing.T, dbPath, query string)

Source from the content-addressed store, hash-verified

1483}
1484
1485func mustQueryDB(t *testing.T, dbPath, query string) string {
1486 t.Helper()
1487 checkDB, err := db.Open(dbPath, false, true)
1488 if err != nil {
1489 t.Fatalf("failed to open database at %s: %s", dbPath, err)
1490 }
1491 defer checkDB.Close()
1492 rows, err := checkDB.QueryStringStmt(query)
1493 if err != nil {
1494 t.Fatalf("failed to query database: %s", err)
1495 }
1496 return asJSON(rows)
1497}
1498
1499func Test_StoreRegisterObserver(t *testing.T) {
1500 dir := t.TempDir()

Callers 3

Test_Store_EndToEndCycleFunction · 0.85
Test_Store_ReapFunction · 0.85

Calls 4

OpenFunction · 0.92
asJSONFunction · 0.70
CloseMethod · 0.65
QueryStringStmtMethod · 0.45

Tested by

no test coverage detected