mysql

package module
v0.20.12 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDriverName is the default driver name for SQLite.
	DefaultDriverName = "mysql"
	// DefaultStringSize is the default string size for mysql
	DefaultStringSize uint = 255
)

Variables

This section is empty.

Functions

func DatetimePrecision

func DatetimePrecision(d int) dao.Option

func DisableDatetimePrecision

func DisableDatetimePrecision(b bool) dao.Option

func DontSupportForShareClause

func DontSupportForShareClause(b bool) dao.Option

func DontSupportRenameColumn

func DontSupportRenameColumn(b bool) dao.Option

func DontSupportRenameIndex

func DontSupportRenameIndex(b bool) dao.Option

func DriverName

func DriverName(name string) dao.Option

func JSONQuery

func JSONQuery(column string) *jsonQueryExpression

func NewDialect

func NewDialect(opts ...dao.Option) dao.Dialect

Example:

mysql.NewDialect(dao.DSN("dao:dao@tcp(localhost:9910)/dao?charset=utf8&parseTime=True&loc=Local"))

func SkipInitializeWithVersion

func SkipInitializeWithVersion(b bool) dao.Option

func StringSize

func StringSize(size uint) dao.Option

func Update

func Update(db *dao.DB)

Types

type Column

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

func (Column) DatabaseTypeName

func (c Column) DatabaseTypeName() string

func (Column) DecimalSize

func (c Column) DecimalSize() (precision int64, scale int64, ok bool)

func (Column) Length

func (c Column) Length() (length int64, ok bool)

func (Column) Name

func (c Column) Name() string

func (Column) Nullable

func (c Column) Nullable() (nullable bool, ok bool)

type Dialect

type Dialect struct {
	DB                        *dao.DB
	Opts                      dao.Options
	DriverName                string
	Conn                      dao.ConnPool
	SkipInitializeWithVersion bool
	DefaultStringSize         uint
	DefaultDatetimePrecision  *int
	DisableDatetimePrecision  bool
	DontSupportRenameIndex    bool
	DontSupportRenameColumn   bool
	DontSupportForShareClause bool
	// contains filtered or unexported fields
}

func (*Dialect) Apply

func (d *Dialect) Apply(options *dao.Options) error

func (*Dialect) BindVarTo

func (d *Dialect) BindVarTo(writer clause.Writer, stmt *dao.Statement, v interface{})

func (*Dialect) ClauseBuilders

func (d *Dialect) ClauseBuilders() map[string]clause.ClauseBuilder

func (*Dialect) DataTypeOf

func (d *Dialect) DataTypeOf(field *schema.Field) string

func (*Dialect) DefaultValueOf

func (d *Dialect) DefaultValueOf(field *schema.Field) clause.Expression

func (*Dialect) Explain

func (d *Dialect) Explain(sql string, vars ...interface{}) string

func (*Dialect) Init

func (d *Dialect) Init(opts ...dao.Option) (err error)

func (*Dialect) JSONBuild

func (d *Dialect) JSONBuild(column string) dao.JSONQuery

func (*Dialect) JSONDataType

func (d *Dialect) JSONDataType() string

func (*Dialect) Migrator

func (d *Dialect) Migrator() dao.Migrator

func (*Dialect) NewTx

func (d *Dialect) NewTx() *dao.DB

func (*Dialect) Options

func (d *Dialect) Options() dao.Options

func (*Dialect) QuoteTo

func (d *Dialect) QuoteTo(writer clause.Writer, str string)

func (*Dialect) RollbackTo

func (d *Dialect) RollbackTo(tx *dao.DB, name string) error

func (*Dialect) SavePoint

func (d *Dialect) SavePoint(tx *dao.DB, name string) error

func (*Dialect) String

func (d *Dialect) String() string

type Migrator

type Migrator struct {
	migrator.Migrator
	*Dialect
}

func (Migrator) AlterColumn

func (m Migrator) AlterColumn(value interface{}, field string) error

func (Migrator) ColumnTypes

func (m Migrator) ColumnTypes(value interface{}) (columnTypes []dao.ColumnType, err error)

func (Migrator) DropConstraint

func (m Migrator) DropConstraint(value interface{}, name string) error

func (Migrator) DropTable

func (m Migrator) DropTable(values ...interface{}) error

func (Migrator) FullDataTypeOf

func (m Migrator) FullDataTypeOf(field *schema.Field) clause.Expr

func (Migrator) Rename

func (m Migrator) Rename(value interface{}, oldName, newName string) error

func (Migrator) RenameIndex

func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error

Jump to

Keyboard shortcuts

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