mysql

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() dbal.Grammar

New Create a new MySQL grammar inteface

Types

type MySQL added in v0.0.3

type MySQL struct {
	sql.SQL
}

MySQL the MySQL Grammar

func (MySQL) CompileInsertOrIgnore added in v0.5.1

func (grammarSQL MySQL) CompileInsertOrIgnore(query *dbal.Query, columns []interface{}, values [][]interface{}) (string, []interface{})

CompileInsertOrIgnore Compile an insert ignore statement into SQL.

func (MySQL) CompileLock added in v0.5.1

func (grammarSQL MySQL) CompileLock(query *dbal.Query, lock interface{}) string

CompileLock the lock into SQL.

func (MySQL) CompileSelect added in v0.5.1

func (grammarSQL MySQL) CompileSelect(query *dbal.Query) string

CompileSelect Compile a select query into SQL.

func (MySQL) CompileSelectOffset added in v0.5.1

func (grammarSQL MySQL) CompileSelectOffset(query *dbal.Query, offset *int) string

CompileSelectOffset Compile a select query into SQL.

func (MySQL) CompileUpsert added in v0.5.1

func (grammarSQL MySQL) CompileUpsert(query *dbal.Query, columns []interface{}, values [][]interface{}, uniqueBy []interface{}, updateValues interface{}) (string, []interface{})

CompileUpsert Upsert new records or update the existing ones.

func (MySQL) NewWith added in v0.0.3

func (grammarSQL MySQL) NewWith(db *sqlx.DB, config *dbal.Config, option *dbal.Option) (dbal.Grammar, error)

NewWith Create a new grammar interface, using the given *sqlx.DB, *dbal.Config and *dbal.Option.

func (MySQL) NewWithRead added in v0.5.1

func (grammarSQL MySQL) NewWithRead(write *sqlx.DB, writeConfig *dbal.Config, read *sqlx.DB, readConfig *dbal.Config, option *dbal.Option) (dbal.Grammar, error)

NewWithRead Create a new grammar interface, using the given *sqlx.DB, *dbal.Config and *dbal.Option.

func (MySQL) OnConnected added in v0.0.3

func (grammarSQL MySQL) OnConnected() error

OnConnected the event will be triggered when db server was connected

type Quoter

type Quoter struct {
	sql.Quoter
}

Quoter the database quoting query text SQL type

func (*Quoter) ID

func (quoter *Quoter) ID(name string) string

ID quoting query Identifier (`id`)

func (*Quoter) VAL

func (quoter *Quoter) VAL(v interface{}) string

VAL quoting query value ( 'value' )

Jump to

Keyboard shortcuts

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