gorm

package
v0.0.0-...-e809a50 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

Connector 连接器

func NewConnector

func NewConnector(config mysql.Config, opts ...Option) Connector

NewConnector 创建一个连接器

func (*Connector) Close

func (c *Connector) Close() error

Close 关闭数据库连接

func (*Connector) Open

func (c *Connector) Open() (*gorm.DB, error)

Connect 连接数据

type Option

type Option func(*Connector)

Option 连接器选项

func WithDialector

func WithDialector(dialector *driver.Dialector) Option

WithDialector 设置Dialector

func WithGormConfig

func WithGormConfig(config *gorm.Config) Option

WithGormConfig 设置gorm专用配置

Jump to

Keyboard shortcuts

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