mysql

package
v0.0.0-...-431a833 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Client() *gorm.DB
}

func NewMySQL

func NewMySQL(config Options) Interface

NewMySQL 根据提供的配置创建一个MySQL数据库接口

type Options

type Options struct {
	Host     string `json:"host,omitempty" yaml:"host,omitempty" xml:"host,omitempty"`
	Port     int    `json:"port,omitempty" yaml:"port,omitempty" xml:"port,omitempty"`
	Username string `json:"username,omitempty" yaml:"username,omitempty" xml:"username,omitempty"`
	Password string `json:"password,omitempty" yaml:"password,omitempty" xml:"password,omitempty"`
	DB       string `json:"db,omitempty" yaml:"db,omitempty" xml:"db,omitempty"`
}

func NewMysqlOptions

func NewMysqlOptions() *Options

func (*Options) Client

func (r *Options) Client() *gorm.DB

Jump to

Keyboard shortcuts

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