Documentation
¶
Index ¶
- Variables
- func AddDB(name string, config *DBConfig)
- func FetchAll(rows *sql.Rows, err error) ([]map[string]interface{}, error)
- func GetDBClient(name string) (*sql.DB, error)
- func LastInsertId(result sql.Result, err error) (int64, error)
- func RegisterDB()
- func RowsAffected(result sql.Result, err error) (int64, error)
- type DB
- type DBConfig
- type Tx
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = fmt.Errorf("not found")
)
Functions ¶
func RegisterDB ¶
func RegisterDB()
Types ¶
type DBConfig ¶
type DBConfig struct {
DriverName string `json:"driver" yaml:"driver"`
DSN string `json:"dsn" yaml:"dsn"`
// ConnMaxIdleTime int `json:"connmaxidletime" yaml:"connmaxidletime"`
ConnMaxLifetime int `json:"connmaxlifetime" yaml:"connmaxlifetime"`
MaxIdleConns int `json:"maxidleconns" yaml:"maxidleconns"`
MaxOpenConns int `json:"maxopenconns" yaml:"maxopenconns"`
}
Click to show internal directories.
Click to hide internal directories.