driver

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitClickhouse added in v1.0.3

func InitClickhouse(config vars.DatabaseConfig) *gorm.DB

func InitMysql

func InitMysql(config vars.DatabaseConfig) *gorm.DB

Types

type Clickhouse added in v1.0.3

type Clickhouse struct {
	PublicFunc
}

func NewClickhouse added in v1.0.3

func NewClickhouse(config vars.DatabaseConfig) *Clickhouse

func (*Clickhouse) GetTableStructure added in v1.0.3

func (m *Clickhouse) GetTableStructure(schema string, tables []string) []vars.Structure

func (*Clickhouse) GetTpl added in v1.0.3

func (m *Clickhouse) GetTpl() string

func (*Clickhouse) HasSpecialType added in v1.0.3

func (m *Clickhouse) HasSpecialType(fields []vars.Field) (hasNull bool, hasTime bool)

func (*Clickhouse) TransType added in v1.0.3

func (m *Clickhouse) TransType(filedType string, nullable string, name string) string

TransType 翻译数据类型,从clickhouse的格式到golang的格式

type I

type I interface {
	TransType(filedType string, nullable string, name string) string
	GetTableStructure(schema string, tables []string) []vars.Structure
	GetTpl() string
}

func GetInstance

func GetInstance(config vars.DatabaseConfig) I

type Mysql

type Mysql struct {
	PublicFunc
}

func NewMysql

func NewMysql(config vars.DatabaseConfig) *Mysql

func (*Mysql) GetTableStructure

func (m *Mysql) GetTableStructure(schema string, tables []string) []vars.Structure

func (*Mysql) GetTpl added in v1.0.3

func (m *Mysql) GetTpl() string

func (*Mysql) HasSpecialType added in v0.3.0

func (m *Mysql) HasSpecialType(fields []vars.Field) (hasNull bool, hasTime bool, hasSoftDelete int)

func (*Mysql) TransType

func (m *Mysql) TransType(filedType string, nullable string, name string) string

TransType 翻译数据类型,从mysql的格式到golang的格式

type Postgres

type Postgres struct {
	PublicFunc
}

func NewPostgres

func NewPostgres() *Postgres

func (*Postgres) GetTableStructure

func (p *Postgres) GetTableStructure(schema string, tables []string) []vars.Structure

func (*Postgres) GetTpl added in v1.0.3

func (p *Postgres) GetTpl() string

func (*Postgres) Init

func (*Postgres) Init(dbc vars.DatabaseConfig) []vars.Structure

func (*Postgres) TransType

func (p *Postgres) TransType(filedType string, nullable string, name string) string

type PublicFunc

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

PublicFunc 公共方法,可复用

Jump to

Keyboard shortcuts

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