dialect

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnSchema added in v0.3.1

type ColumnSchema interface {
	TableName() string
	ColumnName() string
	DataType() string
	GoType() string
	IsDatetime() bool
	IsPrimaryKey() bool
	IsAutoIncrement() bool
	Index() (name string, unique bool, ok bool)
	Default() (string, bool)
	Size() (int64, bool)
	Precision() (int64, bool)
	Scale() (int64, bool)
	IsNullable() bool
	Extra() (string, bool)
	Comment() (string, bool)
}

type Dialect

type Dialect interface {
	ColumnSchema(tables ...string) ([]ColumnSchema, error)
	ColumnType(name string, size uint64, autoIncrement bool) (typ string, unsigned, null bool)
	DataType(name string, size uint64, unsigned bool, prec, scale int64) string
	Quote(s string) string
	QuoteString(s string) string
	AutoIncrement() string
}

func NewMySQL added in v0.3.1

func NewMySQL(db *sql.DB) Dialect

type MySQL

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

func (*MySQL) AutoIncrement added in v0.2.0

func (d *MySQL) AutoIncrement() string

func (*MySQL) ColumnSchema added in v0.3.1

func (d *MySQL) ColumnSchema(tables ...string) ([]ColumnSchema, error)

func (*MySQL) ColumnType

func (d *MySQL) ColumnType(name string, size uint64, autoIncrement bool) (typ string, unsigned, null bool)

func (*MySQL) DataType added in v0.3.0

func (d *MySQL) DataType(name string, size uint64, unsigned bool, prec, scale int64) string

func (*MySQL) Quote

func (d *MySQL) Quote(s string) string

func (*MySQL) QuoteString added in v0.2.0

func (d *MySQL) QuoteString(s string) string

Jump to

Keyboard shortcuts

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