dialect

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDialect

func RegisterDialect(driver string, dialect Dialect)

RegisterDialect :

Types

type Dialect

type Dialect interface {
	SQLDialect
	Connect(opt *options.ConnectOptions) (connStr string)
	UseDatabase(stmt sqlstmt.Stmt, db string)
	GetVersion(stmt sqlstmt.Stmt)
	GetDatabases(stmt sqlstmt.Stmt)
	CreateDatabase(stmt sqlstmt.Stmt, db string, checkExists bool)
	DropDatabase(stmt sqlstmt.Stmt, db string, checkExists bool)
	HasTable(stmt sqlstmt.Stmt, db, table string)
	HasPrimaryKey(stmt sqlstmt.Stmt, db, table string)
	RenameTable(stmt sqlstmt.Stmt, db, oldName, newName string)
	RenameColumn(stmt sqlstmt.Stmt, db, table, oldColName, newColName string)
	DropColumn(stmt sqlstmt.Stmt, db, table, column string)
	DropTable(stmt sqlstmt.Stmt, db, table string, checkExists bool)
	TruncateTable(stmt sqlstmt.Stmt, db, table string)
	GetColumns(stmt sqlstmt.Stmt, db, table string)
	HasIndexByName(stmt sqlstmt.Stmt, db, table, indexName string)
	HasIndex(stmt sqlstmt.Stmt, dbName, table string, idx indexes.Index)
	GetIndexes(stmt sqlstmt.Stmt, db, table string)
	CreateIndexes(stmt sqlstmt.Stmt, db, table string, idxs []indexes.Index, supportDesc bool)
	DropIndexes(stmt sqlstmt.Stmt, db, table string, idxs []string)
	CreateTable(stmt sqlstmt.Stmt, db, table, pk string, info driver.Info, fields []reflext.StructFielder) (err error)
	AlterTable(stmt sqlstmt.Stmt, db, table, pk string, hasPk bool, info driver.Info, fields []reflext.StructFielder, columns util.StringSlice, indexes util.StringSlice, unsafe bool) (err error)
	InsertInto(stmt sqlstmt.Stmt, db, table, pk string, mapper reflext.StructMapper, codec codec.Codecer, fields []reflext.StructFielder, values reflect.Value, opts *options.InsertOptions) (err error)
	Select(stmt sqlstmt.Stmt, act *actions.FindActions, mode options.LockMode) (err error)
	Update(stmt sqlstmt.Stmt, act *actions.UpdateActions) (err error)
	Delete(stmt sqlstmt.Stmt, act *actions.DeleteActions) (err error)
	SelectStmt(stmt sqlstmt.Stmt, query interface{}) (err error)
	Replace(stmt sqlstmt.Stmt, db, table string, columns []string, query *sql.SelectStmt) (err error)
}

Dialect :

func GetDialectByDriver

func GetDialectByDriver(driver string) Dialect

GetDialectByDriver :

type SQLDialect

type SQLDialect interface {
	TableName(db, table string) string
	Var(i int) string
	Quote(n string) string
	Format(v interface{}) (val string)
}

SQLDialect :

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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