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

Method HandleQuery

IceFireDB-SQLProxy/internal/mysql/handle.go:27–43  ·  view source on GitHub ↗
(c *server.Conn, query string)

Source from the content-addressed store, hash-verified

25}
26
27func (h *Handle) HandleQuery(c *server.Conn, query string) (res *mysql.Result, err error) {
28 // Check if this is a readonly connection attempting a write
29 if h.conn.GetUser() == config.Get().Mysql.Readonly.User && isDML(query) {
30 return nil, errors.New("readonly user cannot execute write operations")
31 }
32
33 res, err = h.conn.Execute(query)
34 if err == nil && isDML(query) {
35 // Determine access type based on connection user
36 accessType := "admin"
37 if h.conn.GetUser() == config.Get().Mysql.Readonly.User {
38 accessType = "readonly"
39 }
40 broadcast(query, accessType)
41 }
42 return
43}
44
45func (h *Handle) HandleFieldList(c *server.Conn, table string, fieldWildcard string) ([]*mysql.Field, error) {
46 return h.conn.FieldList(table, fieldWildcard)

Callers

nothing calls this directly

Calls 5

GetFunction · 0.92
broadcastFunction · 0.85
isDMLFunction · 0.70
ExecuteMethod · 0.65
GetUserMethod · 0.45

Tested by

no test coverage detected