MCPcopy Create free account
hub / github.com/apecloud/myduckserver / ComQuery

Method ComQuery

backend/handler.go:70–80  ·  view source on GitHub ↗

Naive query rewriting. This is just a temporary solution and should be replaced with a more robust implementation.

(
	ctx context.Context,
	c *mysql.Conn,
	query string,
	callback mysql.ResultSpoolFn,
)

Source from the content-addressed store, hash-verified

68func auditResultCallback(audit *QueryAudit, callback mysql.ResultSpoolFn, modifiers ...ResultModifier) mysql.ResultSpoolFn {
69 return wrapResultCallback(func(res *sqltypes.Result, more bool) error {
70 if err := callback(res, more); err != nil {
71 return err
72 }
73 audit.AddRows(len(res.Rows))
74 return nil
75 }, modifiers...)
76}
77
78func (h *MyHandler) ComMultiQuery(
79 ctx context.Context,
80 c *mysql.Conn,
81 query string,
82 callback mysql.ResultSpoolFn,
83) (rest string, returnErr error) {

Callers

nothing calls this directly

Calls 3

applyRequestModifiersFunction · 0.85
wrapResultCallbackFunction · 0.85
ComQueryMethod · 0.65

Tested by

no test coverage detected