const (
DEFAULT_MAX_QUERY_MILLIS = 3000
)
func IsSQLSafe(txt string) bool
**** // Helpers /********* returns true if this string is sql safe (no special characters
type DB struct {
MaxQueryTimeout int
// contains filtered or unexported fields
}
func Open() (*DB, error)
call this once when you startup and cache the result only if there is an error you'll need to retry
func (d *DB) ExecContext(ctx context.Context, name string, query string, args ...interface{}) (sql.Result, error)
"name" will be used to provide timing information as prometheus metric.
func (d *DB) QueryContext(ctx context.Context, name string, query string, args ...interface{}) (*sql.Rows, error)
"name" will be used to provide timing information as prometheus metric.
func (d *DB) QueryRowContext(ctx context.Context, name string, query string, args ...interface{}) *sql.Row
discouraged use. QueryRow() does not provide an error on the query, nor do we get a good timing value. Use QueryContext() instead.