MCPcopy
hub / github.com/rqlite/rqlite / mustQuery

Function mustQuery

db/db_test.go:1551–1557  ·  view source on GitHub ↗

mustQuery executes a query, and panics on failure. Used for queries that should never fail, even taking into account test setup.

(db *DB, stmt string)

Source from the content-addressed store, hash-verified

1549// mustQuery executes a query, and panics on failure. Used for queries that should
1550// never fail, even taking into account test setup.
1551func mustQuery(db *DB, stmt string) []*command.QueryRows {
1552 r, err := db.QueryStringStmt(stmt)
1553 if err != nil {
1554 panic(fmt.Sprintf("failed to query: %s", err.Error()))
1555 }
1556 return r
1557}
1558
1559func asJSON(v any) string {
1560 enc := encoding.Encoder{}

Callers 4

Test_UpdateHook_BasicFunction · 0.70
Test_SwapSuccess_DriverFunction · 0.70
Test_CommitHookFunction · 0.70
Test_Preupdate_BasicFunction · 0.70

Calls 2

ErrorMethod · 0.65
QueryStringStmtMethod · 0.45

Tested by

no test coverage detected