Documentation
¶
Index ¶
- func DSN(username, password, endpoint, port, tls string) string
- func ExecWithBinlogAndFlush(ctx context.Context, db xsql.DB, query ExecQuery, options ExecOptions) error
- func New(creds map[string][]byte, tls *string) xsql.DB
- func QuoteIdentifier(id string) string
- func QuoteValue(id string) string
- func SplitUserHost(user string) (username, host string)
- type ExecOptions
- type ExecQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecWithBinlogAndFlush ¶ added in v0.8.0
func ExecWithBinlogAndFlush(ctx context.Context, db xsql.DB, query ExecQuery, options ExecOptions) error
ExecWithBinlogAndFlush is a wrapper function for xsql.DB.Exec() that allows the execution of optional queries before and after the provided query
func SplitUserHost ¶
SplitUserHost splits a MySQL user by name and host
Types ¶
type ExecOptions ¶ added in v0.8.0
type ExecOptions struct { // Binlog defines whether storing binlogs will be disabled before executing the query. Defaults to true Binlog *bool // Flush defines whether privileges will be flushed after executing the query. Defaults to true Flush *bool }
ExecOptions parametrizes which optional statements will be executed before or after ExecQuery.Query
type ExecQuery ¶ added in v0.8.0
type ExecQuery struct { // Query defines the sql statement to execute Query string // ErrorValue defines what error will be returned if the provided sql statement failed when executing ErrorValue string }
ExecQuery declares the query to execute and its error value if it fails
Click to show internal directories.
Click to hide internal directories.