Documentation ¶
Index ¶
- Constants
- Variables
- func Hex(data []byte) string
- func InClauseForBytes(arr [][]byte) string
- func New(driver string, opts ...database.Option) (db *sqlx.DB, err error)
- func NewTx(ctx context.Context, dbOrTx DbOrTx) (*sqlx.Tx, func(*error), error)
- func SimpleConnect(driver, connectionString string) (sqlDB *sqlx.DB, err error)
- func ToTimeStr(now time.Time) string
- type DbOrTx
- type QueryParameters
Constants ¶
View Source
const (
NullDateTime = "1000-01-01 00:00:00"
)
Variables ¶
View Source
var (
NullTime, _ = time.Parse("2006-01-02 15:04:05", NullDateTime)
ErrInvalidPage = errors.New("invalid page")
ErrInvalidLimit = errors.New("invalid limit")
)
Functions ¶
func InClauseForBytes ¶
func SimpleConnect ¶
Types ¶
type DbOrTx ¶
type DbOrTx interface { GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) }
DbOrTx defines the minimal set of sqlx database we use. Used when a database store needs either a database or a DB transaction.
type QueryParameters ¶
Click to show internal directories.
Click to hide internal directories.