Versions in this module Expand all Collapse all v1 v1.3.3 Mar 28, 2021 Changes in this version + type ModelTime struct + CreatedAt time.Time + UpdatedAt time.Time + type Moments struct + CommentTotal int + Content string + Id int + LikeTotal int + Status int + UserId int + type Photos struct + Id int + MomentId int + Url string type Rows + func (r *Rows) ScanX(pointer ...interface{}) ([]interface{}, error) + type Users struct + CreatedAt time.Time + Id int + Name string + Status int + SuccessTime sql.NullString + UpdatedAt time.Time v1.3.2 Mar 27, 2021 Changes in this version + const AT + const Dollar + const NAMED + const Question + const Unknown + var NameMapper = strings.ToLower + func BindDriver(driverName string, bindType int) + func BindNamed(bindType int, query string, arg interface{}) (string, []interface{}, error) + func BindType(driverName string) int + func ExecNContext(ctx context.Context, e ExtContext, query string, arg interface{}) (sql.Result, error) + func ExecPanic(e IExecute, query string, args ...interface{}) sql.Result + func ExecPanicCtx(ctx context.Context, e IExecuteContext, query string, args ...interface{}) sql.Result + func In(query string, args ...interface{}) (string, []interface{}, error) + func LoadFile(e IExecute, path string) (*sql.Result, error) + func LoadFileContext(ctx context.Context, e IExecuteContext, path string) (*sql.Result, error) + func MapScan(r ColScanner, dest map[string]interface{}) error + func Named(query string, arg interface{}) (string, []interface{}, error) + func NamedExec(e Ext, query string, arg interface{}) (sql.Result, error) + func Rebind(bindType int, query string) string + func Select(q IQuery, pointer interface{}, querySql string, args ...interface{}) error + func SelectCtx(ctx context.Context, q IQueryContext, pointer interface{}, querySql string, ...) error + func SliceScan(r ColScanner) ([]interface{}, error) + func StructScan(rows IRow, dest interface{}) error + func Take(q IQuery, pointer interface{}, querySql string, args ...interface{}) error + func TakeCtx(ctx context.Context, q IQueryContext, pointer interface{}, query string, ...) error + type ColScanner interface + Columns func() ([]string, error) + Err func() error + type Conn struct + Mapper *reflectx.Mapper + func (c *Conn) BeginTxX(ctx context.Context, opts *sql.TxOptions) (*Tx, error) + func (c *Conn) PrepareXCtx(ctx context.Context, query string) (*Stmt, error) + func (c *Conn) QueryRowXCtx(ctx context.Context, query string, args ...interface{}) *Row + func (c *Conn) QueryXCtx(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (c *Conn) Rebind(query string) string + func (c *Conn) SelectCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (c *Conn) TakeCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + type DB struct + Mapper *reflectx.Mapper + func Connect(driverName, dataSourceName string) (*DB, error) + func ConnectCtx(ctx context.Context, driverName, dataSourceName string) (*DB, error) + func NewDB(db *sql.DB, driverName string) *DB + func Open(driverName, dataSourceName string) (*DB, error) + func (db *DB) BeginPanic() *Tx + func (db *DB) BeginPanicTx(ctx context.Context, opts *sql.TxOptions) *Tx + func (db *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) + func (db *DB) BeginX() (*Tx, error) + func (db *DB) BindNamed(query string, arg interface{}) (string, []interface{}, error) + func (db *DB) ConnX(ctx context.Context) (*Conn, error) + func (db *DB) DriverName() string + func (db *DB) ExecN(query string, arg interface{}) (sql.Result, error) + func (db *DB) ExecNCtx(ctx context.Context, query string, arg interface{}) (sql.Result, error) + func (db *DB) ExecPanic(query string, args ...interface{}) sql.Result + func (db *DB) ExecPanicCtx(ctx context.Context, query string, args ...interface{}) sql.Result + func (db *DB) MapperFunc(mf func(string) string) + func (db *DB) PrepareN(query string) (*StmtN, error) + func (db *DB) PrepareNCtx(ctx context.Context, query string) (*StmtN, error) + func (db *DB) PrepareX(query string) (*Stmt, error) + func (db *DB) PrepareXCtx(ctx context.Context, query string) (*Stmt, error) + func (db *DB) QueryN(query string, arg interface{}) (*Rows, error) + func (db *DB) QueryNCtx(ctx context.Context, query string, arg interface{}) (*Rows, error) + func (db *DB) QueryRowX(query string, args ...interface{}) *Row + func (db *DB) QueryRowXCtx(ctx context.Context, query string, args ...interface{}) *Row + func (db *DB) QueryX(query string, args ...interface{}) (*Rows, error) + func (db *DB) QueryXCtx(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (db *DB) Rebind(query string) string + func (db *DB) Select(pointer interface{}, querySql string, args ...interface{}) error + func (db *DB) SelectCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (db *DB) Take(pointer interface{}, querySql string, args ...interface{}) error + func (db *DB) TakeCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (db *DB) Unsafe() *DB + type Ext interface + type ExtContext interface + type IBind interface + BindNamed func(string, interface{}) (string, []interface{}, error) + DriverName func() string + Rebind func(string) string + type IExecute interface + Exec func(query string, args ...interface{}) (sql.Result, error) + type IExecuteContext interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + type IPrepare interface + Prepare func(query string) (*sql.Stmt, error) + type IPrepareContext interface + PrepareContext func(ctx context.Context, query string) (*sql.Stmt, error) + type IQuery interface + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRowX func(query string, args ...interface{}) *Row + QueryX func(query string, args ...interface{}) (*Rows, error) + type IQueryContext interface + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRowXCtx func(ctx context.Context, query string, args ...interface{}) *Row + QueryXCtx func(ctx context.Context, query string, args ...interface{}) (*Rows, error) + type IRow interface + Close func() error + Columns func() ([]string, error) + Err func() error + Next func() bool + Scan func(...interface{}) error + type ISql interface + DriverName func() string + Exec func(querySql string, args ...interface{}) (sql.Result, error) + PrepareX func(query string) (*Stmt, error) + QueryRowX func(querySql string, args ...interface{}) *Row + QueryX func(querySql string, args ...interface{}) (*Rows, error) + Rebind func(querySql string) string + Select func(pointer interface{}, querySql string, args ...interface{}) error + Take func(pointer interface{}, querySql string, args ...interface{}) error + type Row struct + Mapper *reflectx.Mapper + func (r *Row) ColumnTypes() ([]*sql.ColumnType, error) + func (r *Row) Columns() ([]string, error) + func (r *Row) Err() error + func (r *Row) Scan(pointer interface{}) ([]interface{}, error) + type Rows struct + Mapper *reflectx.Mapper + func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) + func QueryNContext(ctx context.Context, e ExtContext, query string, arg interface{}) (*Rows, error) + func (r *Rows) MapScan(pointer map[string]interface{}) error + func (r *Rows) SliceScan() ([]interface{}, error) + func (r *Rows) StructScan(pointer interface{}) error + type Stmt struct + Mapper *reflectx.Mapper + func PrepareX(p IPrepare, query string) (*Stmt, error) + func PrepareXCtx(ctx context.Context, p IPrepareContext, query string) (*Stmt, error) + func (s *Stmt) ExecPanic(args ...interface{}) sql.Result + func (s *Stmt) ExecPanicCtx(ctx context.Context, args ...interface{}) sql.Result + func (s *Stmt) QueryRowX(args ...interface{}) *Row + func (s *Stmt) QueryRowXCtx(ctx context.Context, args ...interface{}) *Row + func (s *Stmt) QueryX(args ...interface{}) (*Rows, error) + func (s *Stmt) QueryXCtx(ctx context.Context, args ...interface{}) (*Rows, error) + func (s *Stmt) Select(pointer interface{}, args ...interface{}) error + func (s *Stmt) SelectCtx(ctx context.Context, dest interface{}, args ...interface{}) error + func (s *Stmt) Take(pointer interface{}, args ...interface{}) error + func (s *Stmt) TakeCtx(ctx context.Context, dest interface{}, args ...interface{}) error + func (s *Stmt) Unsafe() *Stmt + type StmtN struct + Params []string + QueryString string + Stmt *Stmt + func (n *StmtN) Close() error + func (n *StmtN) Exec(arg interface{}) (sql.Result, error) + func (n *StmtN) ExecCtx(ctx context.Context, arg interface{}) (sql.Result, error) + func (n *StmtN) ExecPanic(arg interface{}) sql.Result + func (n *StmtN) ExecPanicCtx(ctx context.Context, arg interface{}) sql.Result + func (n *StmtN) Query(arg interface{}) (*sql.Rows, error) + func (n *StmtN) QueryCtx(ctx context.Context, arg interface{}) (*sql.Rows, error) + func (n *StmtN) QueryRow(arg interface{}) *Row + func (n *StmtN) QueryRowCtx(ctx context.Context, arg interface{}) *Row + func (n *StmtN) QueryRowX(arg interface{}) *Row + func (n *StmtN) QueryRowXCtx(ctx context.Context, arg interface{}) *Row + func (n *StmtN) QueryX(arg interface{}) (*Rows, error) + func (n *StmtN) QueryXCtx(ctx context.Context, arg interface{}) (*Rows, error) + func (n *StmtN) Select(pointer interface{}, arg interface{}) error + func (n *StmtN) SelectCtx(ctx context.Context, dest interface{}, arg interface{}) error + func (n *StmtN) Take(pointer interface{}, arg interface{}) error + func (n *StmtN) TakeCtx(ctx context.Context, dest interface{}, arg interface{}) error + func (n *StmtN) Unsafe() *StmtN + type Tx struct + Mapper *reflectx.Mapper + func (tx *Tx) BindNamed(query string, arg interface{}) (string, []interface{}, error) + func (tx *Tx) DriverName() string + func (tx *Tx) ExecN(query string, arg interface{}) (sql.Result, error) + func (tx *Tx) ExecNCtx(ctx context.Context, query string, arg interface{}) (sql.Result, error) + func (tx *Tx) ExecPanic(query string, args ...interface{}) sql.Result + func (tx *Tx) ExecPanicCtx(ctx context.Context, query string, args ...interface{}) sql.Result + func (tx *Tx) PrepareN(query string) (*StmtN, error) + func (tx *Tx) PrepareNCtx(ctx context.Context, query string) (*StmtN, error) + func (tx *Tx) PrepareX(query string) (*Stmt, error) + func (tx *Tx) PrepareXCtx(ctx context.Context, query string) (*Stmt, error) + func (tx *Tx) QueryN(query string, arg interface{}) (*Rows, error) + func (tx *Tx) QueryRowX(query string, args ...interface{}) *Row + func (tx *Tx) QueryRowXCtx(ctx context.Context, query string, args ...interface{}) *Row + func (tx *Tx) QueryX(query string, args ...interface{}) (*Rows, error) + func (tx *Tx) QueryXCtx(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (tx *Tx) Rebind(query string) string + func (tx *Tx) Select(pointer interface{}, query string, args ...interface{}) error + func (tx *Tx) SelectCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (tx *Tx) StmtN(stmt *StmtN) *StmtN + func (tx *Tx) StmtNCtx(ctx context.Context, stmt *StmtN) *StmtN + func (tx *Tx) StmtX(stmt interface{}) *Stmt + func (tx *Tx) StmtXCtx(ctx context.Context, stmt interface{}) *Stmt + func (tx *Tx) Take(pointer interface{}, query string, args ...interface{}) error + func (tx *Tx) TakeCtx(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (tx *Tx) Unsafe() *Tx v1.3.1 Mar 20, 2021