MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Handler

Interface Handler

IceFireDB-SQLProxy/pkg/mysql/server/command.go:12–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10)
11
12type Handler interface {
13 // close conn
14 CloseConn(c *Conn) error
15 // handle COM_INIT_DB command, you can check whether the dbName is valid, or other.
16 UseDB(conn *Conn, dbName string) error
17 // handle COM_QUERY command, like SELECT, INSERT, UPDATE, etc...
18 // If Result has a Resultset (SELECT, SHOW, etc...), we will send this as the response, otherwise, we will send Result
19 HandleQuery(conn *Conn, query string) (*Result, error)
20 // handle COM_FILED_LIST command
21 HandleFieldList(conn *Conn, table string, fieldWildcard string) ([]*Field, error)
22 // handle COM_STMT_PREPARE, params is the param number for this statement, columns is the column number
23 // context will be used later for statement execute
24 HandleStmtPrepare(conn *Conn, query string) (params int, columns int, context any, err error)
25 // handle COM_STMT_EXECUTE, context is the previous one set in prepare
26 // query is the statement prepare query, and args is the params for this statement
27 HandleStmtExecute(conn *Conn, context any, query string, args []any) (*Result, error)
28 // handle COM_STMT_CLOSE, context is the previous one set in prepare
29 // this handler has no response
30 HandleStmtClose(conn *Conn, context any) error
31 // handle any other command that is not currently handled by the library,
32 // default implementation for this method will return an ER_UNKNOWN_ERROR
33 HandleOtherCommand(conn *Conn, cmd byte, data []byte) error
34}
35
36func (c *Conn) HandleCommand() error {
37 if c.Conn == nil {

Callers

nothing calls this directly

Implementers 2

HandleIceFireDB-SQLProxy/internal/mysql/hand
mysqlProxyIceFireDB-SQLite/internal/mysql/proxy.

Calls

no outgoing calls

Tested by

no test coverage detected