mysql

package module
v0.0.0-...-8585d0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: LGPL-2.1 Imports: 10 Imported by: 0

README

测试

docker run -it --rm --name mysql5.7 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOption = option{

	ParseTime: true,
	// contains filtered or unexported fields
}

Functions

func NewOption

func NewOption(options ...OptionFunc) *option

Types

type MysqlDriver

type MysqlDriver struct {
	*gorm.DB
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(opt *option) (*MysqlDriver, error)

func (*MysqlDriver) Connection

func (d *MysqlDriver) Connection() error

func (*MysqlDriver) CreateDatabase

func (d *MysqlDriver) CreateDatabase(name string) error

CreateDatabase 创建新的数据库 指定名字,指定charset 引擎 之类

func (*MysqlDriver) DNS

func (d *MysqlDriver) DNS(db bool) string

type OptionFunc

type OptionFunc = func(o *option)

func WithDbName

func WithDbName(dbname string) OptionFunc

func WithHost

func WithHost(host string) OptionFunc

func WithLoggerLevel

func WithLoggerLevel(l logger.LogLevel) OptionFunc

func WithLoggerOut

func WithLoggerOut(w io.Writer) OptionFunc

func WithPassword

func WithPassword(password string) OptionFunc

func WithUserName

func WithUserName(username string) OptionFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL