Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KvEncoder ¶
type KvEncoder interface { // Encode transfers sql to kv pairs. // Before use Encode() method, please make sure you already created schame by calling ExecDDLSQL() method. // NOTE: now we just support transfers insert statement to kv pairs. // (if we wanna support other statement, we need to add a kv.Storage parameter, // and pass tikv store in.) // return encoded kvs array that generate by sql, and affectRows count. Encode(sql string, tableID int64) (kvPairs []KvPair, affectedRows uint64, err error) // PrepareStmt prepare query statement, and return statement id. // Pass stmtID into EncodePrepareStmt to execute a prepare statement. PrepareStmt(query string) (stmtID uint32, err error) // EncodePrepareStmt transfer prepare query to kv pairs. // stmtID is generated by PrepareStmt. EncodePrepareStmt(tableID int64, stmtID uint32, param ...interface{}) (kvPairs []KvPair, affectedRows uint64, err error) // ExecDDLSQL executes ddl sql, you must use it to create schema infos. ExecDDLSQL(sql string) error // EncodeMetaAutoID encode the table meta info, autoID to coresponding key-value pair. EncodeMetaAutoID(dbID, tableID, autoID int64) (KvPair, error) // SetSystemVariable set system variable name = value. SetSystemVariable(name string, value string) error // GetSystemVariable get the system variable value of name. GetSystemVariable(name string) (string, bool) // Close cleanup the kvEncoder. Close() error }
KvEncoder is an encoder that transfer sql to key-value pairs.
Click to show internal directories.
Click to hide internal directories.