Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RawQueryOption is the raw query option. // rawQueryOption convert the '?' place to real data. // Ex: "SELECT a FROM b WHERE c = ?" will be "SELECT a FROM b WHERE c = d ". RawQueryOption = rawQueryOption{} // IgnoreSelectColumnsOption enable the ignore select columns option, // Ex: "SELECT A,B FROM C WHERE D = ?" will be "SELECT ... FROM C WHERE D = ?". IgnoreSelectColumnsOption = ignoreSelectColumnsOption{} )
Functions ¶
This section is empty.
Types ¶
type ExecContextFunc ¶
define the exec func with context.
type QueryContextFunc ¶
define the query func with context.
type TracerOption ¶
TracerOption define the wrapper's option
type TracerWrapper ¶
type TracerWrapper struct {
// contains filtered or unexported fields
}
func NewMsSQLTracerWrapper ¶
func NewMsSQLTracerWrapper() *TracerWrapper
Init TracerWrapper with default ignoreSelectColumnsOption.
func NewMsSQLTracerWrapperWithOpts ¶
func NewMsSQLTracerWrapperWithOpts(options ...TracerOption) *TracerWrapper
Init pure TracerWrapper with set options.
func NewMySQLTracerWrapper ¶
func NewMySQLTracerWrapper() *TracerWrapper
Init TracerWrapper with default ignoreSelectColumnsOption.
func NewMySQLTracerWrapperWithOpts ¶
func NewMySQLTracerWrapperWithOpts(options ...TracerOption) *TracerWrapper
Init pure TracerWrapper with set options.
func NewTracerWrapper ¶
func NewTracerWrapper(dbType string) *TracerWrapper
func (*TracerWrapper) QueryBuilder ¶
func (t *TracerWrapper) QueryBuilder(query string, args ...interface{}) string
func (*TracerWrapper) WrapExecContext ¶
func (t *TracerWrapper) WrapExecContext(fn ExecContextFunc) ExecContextFunc
For sql's update、insert、delete ...
func (*TracerWrapper) WrapQueryContext ¶
func (t *TracerWrapper) WrapQueryContext(fn QueryContextFunc) QueryContextFunc
For sql's select ...
type Wrapper ¶
type Wrapper interface { WrapQueryContext(fn QueryContextFunc) QueryContextFunc WrapExecContext(fn ExecContextFunc) ExecContextFunc }
define the database operation.
Click to show internal directories.
Click to hide internal directories.