Documentation
¶
Index ¶
- Variables
- func BytesToString(b []byte) string
- func CheckTxIsolation(tx *sql.Tx, level string) error
- func ClickHouseToDriverType(psql string) interface{}
- func EscapeQuotes(s string, quote byte) string
- func ExecSQL(d *sql.DB, query string, param ...interface{}) error
- func ExecTxSQL(tx *sql.Tx, query string, param ...interface{}) error
- func HTTPGet(ctx context.Context, url string) (body []byte, err error)
- func HTTPGetWithHeaders(_ context.Context, url string, headers map[string]string) (body []byte, err error)
- func HTTPPostJSON(url string, body string) error
- func HTTPPostJSONWithHeaders(url string, body string, headers map[string]string) error
- func MySQLError(err error, code uint16) bool
- func MySQLEscape(backslash bool, s string) string
- func MySQLToDriverType(mtype string, ftype string) interface{}
- func PostgresToDriverType(psql string) interface{}
- func QueryRowSQL(d *sql.DB, query string, param ...interface{}) *sql.Row
- func QuerySQL(d *sql.DB, query string, param ...interface{}) (*sql.Rows, error)
- func QueryTxRowSQL(tx *sql.Tx, query string, param ...interface{}) *sql.Row
- func QueryTxSQL(tx *sql.Tx, query string, param ...interface{}) (*sql.Rows, error)
- func SortedGTIDString(set *gomysql.MysqlGTIDSet) string
Constants ¶
This section is empty.
Variables ¶
var Timeout = 15 * time.Second
Timeout is a http request wait timeout
Functions ¶
func BytesToString ¶
BytesToString converts zero terminated byte array to string Whole array is used when there is no zero in the string
func CheckTxIsolation ¶
CheckTxIsolation return nil if transaction isolation is "level"
func ClickHouseToDriverType ¶
func ClickHouseToDriverType(psql string) interface{}
ClickHouseToDriverType converts mysql type names to sql driver type suitable for scan
func EscapeQuotes ¶
EscapeQuotes escapes given quote by doubling it
func HTTPGetWithHeaders ¶
func HTTPGetWithHeaders(_ context.Context, url string, headers map[string]string) (body []byte, err error)
HTTPGetWithHeaders helper which returns response as a byte array
func HTTPPostJSON ¶
HTTPPostJSON posts given JSON message to given URL
func HTTPPostJSONWithHeaders ¶
HTTPPostJSONWithHeaders posts given JSON message to given URL
func MySQLError ¶
MySQLError checks if givens error is MySQL error with given code
func MySQLEscape ¶
MySQLEscape returns escaped string escaping backslashes or duplicating single quotes, based on backslash parameter
func MySQLToDriverType ¶
MySQLToDriverType converts mysql type names to sql driver type suitable for scan FIXME: Use sql.ColumnType.DatabaseType instead if this function if go1.8 is * used
func PostgresToDriverType ¶
func PostgresToDriverType(psql string) interface{}
PostgresToDriverType converts mysql type names to sql driver type suitable for scan
func QueryRowSQL ¶
QueryRowSQL executes SQL query which return single row
func QueryTxRowSQL ¶
QueryTxRowSQL executes SQL query which return single row
func QueryTxSQL ¶
QueryTxSQL executes SQL query
func SortedGTIDString ¶
func SortedGTIDString(set *gomysql.MysqlGTIDSet) string
SortedGTIDString convert GTID set into string, where UUIDs comes in lexicographically sorted order. The order is the same as in output of select @@global.gtid_executed
Types ¶
This section is empty.