Documentation ¶
Overview ¶
Package database Date: 2023/4/4 13:57 Author: Amu Description:
Package database Date: 2023/12/6 15:46 Author: Amu Description:
Package database Date: 2023/12/6 17:27 Author: Amu Description:
Index ¶
- type DB
- type Option
- func WithDBName(name string) Option
- func WithDebug(debug bool) Option
- func WithHost(host string) Option
- func WithMaxIdleConns(maxIdle int) Option
- func WithMaxLifetime(lifetime int) Option
- func WithMaxOpenConns(maxOpen int) Option
- func WithPassword(password string) Option
- func WithPort(port string) Option
- func WithType(t string) Option
- func WithUsername(username string) Option
- type QueryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func OptionDB ¶
func OptionDB(db *DB, options ...QueryOption) *DB
func (*DB) AutoMigrate ¶
type Option ¶
type Option func(*option)
func WithDBName ¶
func WithMaxIdleConns ¶
func WithMaxLifetime ¶
func WithMaxOpenConns ¶
func WithPassword ¶
func WithUsername ¶
type QueryOption ¶
func OrderBy ¶
func OrderBy(value interface{}) QueryOption
func WithById ¶
func WithById(id string) QueryOption
func WithInIds ¶
func WithInIds(ids ...string) QueryOption
func WithLimit ¶
func WithLimit(limit int) QueryOption
func WithOffset ¶
func WithOffset(offset int) QueryOption
func WithTable ¶
func WithTable(tableName string) QueryOption
Click to show internal directories.
Click to hide internal directories.