db

package
v0.0.0-...-121d9cc Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	*dbr.Connection
	Name string
}

Connection

func Open

func Open(dataSource string, providerName string) *Connection

Open

func (*Connection) NewSession

func (c *Connection) NewSession() *dbr.Session

NewSession

type DBAttr

type DBAttr struct {
	ProviderName string
	TableName    string
	Package      string
	TableFields  []FieldAttr
}

DBAttr

func QueryDBAttr

func QueryDBAttr(conn *Connection, tableName string, packageName string) *DBAttr

QueryDBAttr

func (*DBAttr) Inject

func (d *DBAttr) Inject() string

Inject

func (*DBAttr) LowTable

func (d *DBAttr) LowTable() (name string)

LowTable

func (*DBAttr) Table

func (d *DBAttr) Table() (name string)

Table

type DBConf

type DBConf struct {
	Driver     string `default:"mysql"`
	DataSource string
	DBName     string
	UserName   string
	Password   string
	Host       string
	Port       int

	MaxIdleConns int
	MaxOpenConns int

	ProvideName string
}

DBConf

func GetDBConf

func GetDBConf(path string) *DBConf

GetDBConf

func (*DBConf) Datasource

func (c *DBConf) Datasource() string

Datasource

type FieldAttr

type FieldAttr struct {
	Field   string
	Type    sql.RawBytes
	Null    sql.RawBytes
	Key     sql.RawBytes
	Default sql.RawBytes
	Extra   sql.RawBytes
}

FieldAttr

func (FieldAttr) CamelField

func (t FieldAttr) CamelField() (field string)

CamelField

func (FieldAttr) FieldType

func (t FieldAttr) FieldType() string

FieldType

Jump to

Keyboard shortcuts

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