MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / QueryWithContext

Method QueryWithContext

xenomint/state.go:690–702  ·  view source on GitHub ↗

QueryWithContext does the query(ies) in req, pools the request and persists any change to the underlying storage.

(
	ctx context.Context, req *types.Request, isLeader bool)

Source from the content-addressed store, hash-verified

688// QueryWithContext does the query(ies) in req, pools the request and persists any change to
689// the underlying storage.
690func (s *State) QueryWithContext(
691 ctx context.Context, req *types.Request, isLeader bool) (ref *QueryTracker, resp *types.Response, err error,
692) {
693 switch req.Header.QueryType {
694 case types.ReadQuery:
695 return s.readTx(ctx, req)
696 case types.WriteQuery:
697 return s.write(ctx, req, isLeader)
698 default:
699 err = ErrInvalidRequest
700 }
701 return
702}
703
704// Replay replays a write log from other peer to replicate storage state.
705func (s *State) Replay(req *types.Request, resp *types.Response) (err error) {

Callers 2

QueryMethod · 0.95
QueryMethod · 0.80

Calls 2

readTxMethod · 0.95
writeMethod · 0.95

Tested by

no test coverage detected