dialect

package
v0.0.0-...-a98f5d9 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRIVER_NAME_MYSQL      = "mysql"
	DRIVER_NAME_SQLITE3    = "sqlite3"
	DRIVER_NAME_POSTGRESQL = "postgresql"
)

Variables

This section is empty.

Functions

func Register

func Register(name string, dialect Dialect)

Register registers a dialect to the global variable

Types

type Dialect

type Dialect interface {
	// GetDriverName gets the driver name of the DB
	GetDriverName() string
	// GetDataTypeOf gets a datatype for a DB Dialect
	GetDataTypeOf(typ reflect.Value) string
	// GetTableExistSQL returns SQL that judge whether the table exists in database
	GetTableExistSQL(dbName, tabName string) (string, []any)
}

Dialect is an interface contains methods that a dialect has to implement

func Get

func Get(name string) (Dialect, bool)

Get gets the dialect from global variable if it exists

Jump to

Keyboard shortcuts

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