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

Method HandleQuery

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

Source from the content-addressed store, hash-verified

25}
26
27func (h *mysqlProxy) HandleQuery(c *server.Conn, query string) (res *mysql.Result, err error) {
28 if strings.ToUpper(query[:3]) == "SET" {
29 res = &mysql.Result{
30 Status: 2,
31 }
32 return
33 }
34 if strings.ToUpper(query) == "SELECT VERSION()" {
35 query = "SELECT SQLITE_VERSION()"
36 //query = "SELECT '5.7.30-log' AS 'VERSION()'"
37 }
38 if strings.ToUpper(query) == "SELECT NOW()" {
39 query = "SELECT STRFTIME('%Y-%m-%d %H:%M:%S','now') AS 'NOW()'"
40 }
41 //if strings.ToUpper(query) == "START TRANSACTION" {
42 // res = &mysql.Result{
43 // Status: 2,
44 // }
45 // return
46 //}
47 return sqlite.Exec(query)
48}
49
50func (h *mysqlProxy) HandleFieldList(c *server.Conn, table string, fieldWildcard string) ([]*mysql.Field, error) {
51 //return h.conn.FieldList(table, fieldWildcard)

Callers

nothing calls this directly

Calls 1

ExecFunction · 0.92

Tested by

no test coverage detected