Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeDDL = "DDL" TypeDML = "DML" TypeDCL = "DCL" TypeTCL = "TCL" TypeUnknown = "Unknown" )
Query
View Source
const ( StmtSelect = "SELECT" StmtInsert = "INSERT" StmtReplace = "REPLACE" StmtMerge = "MERE" StmtCall = "CALL" StmtUpdate = "UPDATE" StmtDelete = "DELETE" StmtBegin = "BEGIN" StmtCommit = "COMMIT" StmtRollback = "ROLLBACK" StmtSavePoint = "SAVEPOINT" StmtSet = "SET" StmtShow = "SHOW" StmtUse = "USE" StmtCreate = "CREATE" StmtAlert = "ALERT" StmtDrop = "DROP" StmtTruncate = "TRUNCATE" StmtComment = "COMMENT" StmtRename = "RENAME" StmtGrant = "GRANT" StmtRevoke = "REVOKE" StmtExplainPlan = "EXPLAINPLAN" StmtLockTable = "LOCKTABLE" StmtSetTransaction = "SETTRANSATION" StmtOther = "OTHER" StmtUnknown = "UNKNOWN" )
Statement
Variables ¶
This section is empty.
Functions ¶
func ExtractTableNames ¶
ExtractTableNames from sql statement
func GetTableName ¶
GetTableName from sql select statement
Types ¶
type QueryAction ¶
type QueryAction struct {
QueryContext
Action string
Duration time.Duration
Tables []string
QueryType string
}
QueryAction action and duration
type QueryContext ¶
type QueryContext struct {
Query []byte
User []byte
Client []byte
Database []byte
Time time.Time
SessionID string
ServerIP string
ServerPort uint
}
QueryContext holds information around query
func (*QueryContext) Marshal ¶
func (c *QueryContext) Marshal() []byte
Marshal load []byte into QueryContext
func (*QueryContext) Unmarshal ¶
func (c *QueryContext) Unmarshal(b []byte) (size uint32)
Unmarshal []byte into QueryContext
Click to show internal directories.
Click to hide internal directories.