Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Begin() (*Tx, error)
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Context() context.Context
- func (db *DB) Delete(query string, args ...interface{}) (Result, error)
- func (db *DB) DeleteContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (db *DB) Exec(query string, args ...interface{}) (Result, error)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (db *DB) Insert(sqlHead string, args ...interface{}) (Result, error)
- func (db *DB) InsertContext(ctx context.Context, sqlHead string, args ...interface{}) (Result, error)
- func (db *DB) Mapping() *sync.Map
- func (db *DB) Placeholder() string
- func (db *DB) PlaceholderBuilder() func(int) string
- func (db *DB) Prepare(query string) (*Stmt, error)
- func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (db *DB) Query(dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) QueryContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) QueryRow(dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) QueryRowContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) Quote() string
- func (db *DB) RawScan() bool
- func (db *DB) Select(dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) SelectContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (db *DB) SetContext(ctx context.Context)
- func (db *DB) SetFieldParser(f FieldParser)
- func (db *DB) SetPlaceholder(placeholder string)
- func (db *DB) SetPlaceholderBuilder(placeholderBuilder func(int) string)
- func (db *DB) SetQuote(quote string)
- func (db *DB) SetRawScan(rawScan bool)
- func (db *DB) SetTag(tag string)
- func (db *DB) Tag() string
- func (db *DB) Update(sqlHead string, args ...interface{}) (Result, error)
- func (db *DB) UpdateContext(ctx context.Context, sqlHead string, args ...interface{}) (Result, error)
- type Field
- func (field *Field) Bool() bool
- func (field *Field) Bytes() []byte
- func (field *Field) Float64() float64
- func (field *Field) Int64() int64
- func (field *Field) Scan(v interface{}) error
- func (field *Field) String() string
- func (field *Field) Time() time.Time
- func (field *Field) ToValue(dstVal reflect.Value)
- func (field *Field) Uint64() uint64
- type FieldParser
- type MappingInfo
- type Result
- type Selector
- type Stmt
- func (stmt *Stmt) Delete(args ...interface{}) (Result, error)
- func (stmt *Stmt) DeleteContext(ctx context.Context, args ...interface{}) (Result, error)
- func (stmt *Stmt) Exec(args ...interface{}) (Result, error)
- func (stmt *Stmt) ExecContext(ctx context.Context, args ...interface{}) (Result, error)
- func (stmt *Stmt) Insert(args ...interface{}) (Result, error)
- func (stmt *Stmt) InsertContext(ctx context.Context, args ...interface{}) (Result, error)
- func (stmt *Stmt) Query(dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) QueryContext(ctx context.Context, dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) QueryRow(dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) QueryRowContext(ctx context.Context, dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) Select(dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) SelectContext(ctx context.Context, dst interface{}, args ...interface{}) (Result, error)
- func (stmt *Stmt) Sql(ctx context.Context, dst interface{}, args ...interface{}) string
- func (stmt *Stmt) Update(args ...interface{}) (Result, error)
- func (stmt *Stmt) UpdateContext(ctx context.Context, args ...interface{}) (Result, error)
- type Tx
- func (tx *Tx) Delete(query string, args ...interface{}) (Result, error)
- func (tx *Tx) DeleteContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (tx *Tx) Exec(query string, args ...interface{}) (Result, error)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (tx *Tx) Insert(sqlHead string, args ...interface{}) (Result, error)
- func (tx *Tx) InsertContext(ctx context.Context, sqlHead string, args ...interface{}) (Result, error)
- func (tx *Tx) Prepare(query string) (*Stmt, error)
- func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (tx *Tx) Query(dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) QueryContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) QueryRow(dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) QueryRowContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) Select(dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) SelectContext(ctx context.Context, dst interface{}, query string, args ...interface{}) (Result, error)
- func (tx *Tx) Stmt(stmt *Stmt) *Stmt
- func (tx *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt
- func (tx *Tx) Update(sqlHead string, args ...interface{}) (Result, error)
- func (tx *Tx) UpdateContext(ctx context.Context, sqlHead string, args ...interface{}) (Result, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type DB ¶
func OpenContext ¶
func (*DB) DeleteContext ¶
func (*DB) ExecContext ¶
func (*DB) InsertContext ¶
func (*DB) Placeholder ¶
func (*DB) PlaceholderBuilder ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
func (*DB) SelectContext ¶
func (*DB) SetContext ¶
func (*DB) SetFieldParser ¶
func (db *DB) SetFieldParser(f FieldParser)
func (*DB) SetPlaceholder ¶
func (*DB) SetPlaceholderBuilder ¶
func (*DB) SetRawScan ¶
type FieldParser ¶
type FieldParser func(field *reflect.StructField) string
type MappingInfo ¶
type Stmt ¶
func (*Stmt) DeleteContext ¶
func (*Stmt) ExecContext ¶
func (*Stmt) InsertContext ¶
func (*Stmt) QueryContext ¶
func (*Stmt) QueryRowContext ¶
func (*Stmt) SelectContext ¶
type Tx ¶
func (*Tx) DeleteContext ¶
func (*Tx) ExecContext ¶
func (*Tx) InsertContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
func (*Tx) SelectContext ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.