sqldialect

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedDialects = map[string]Provider{
	"postgres":  &PostgresDialect{},
	"sqlite3":   &Sqlite3Dialect{},
	"mysql":     &MysqlDialect{},
	"sqlserver": &SqlserverDialect{},
}

Functions

This section is empty.

Types

type InsertMethod

type InsertMethod int
const (
	InsertWithReturning InsertMethod = iota
	InsertWithOutput
	InsertWithLastInsertID
	InsertWithNoIDRetrieval
)

type MysqlDialect

type MysqlDialect struct{}

func (MysqlDialect) DriverName

func (MysqlDialect) DriverName() string

func (MysqlDialect) Escape

func (MysqlDialect) Escape(str string) string

func (MysqlDialect) InsertMethod

func (MysqlDialect) InsertMethod() InsertMethod

func (MysqlDialect) Placeholder

func (MysqlDialect) Placeholder(idx int) string

type PostgresDialect

type PostgresDialect struct{}

func (PostgresDialect) DriverName

func (PostgresDialect) DriverName() string

func (PostgresDialect) Escape

func (PostgresDialect) Escape(str string) string

func (PostgresDialect) InsertMethod

func (PostgresDialect) InsertMethod() InsertMethod

func (PostgresDialect) Placeholder

func (PostgresDialect) Placeholder(idx int) string

type Provider

type Provider interface {
	InsertMethod() InsertMethod
	Escape(str string) string
	Placeholder(idx int) string
	DriverName() string
}

Provider or dialect.Provider represents one particular way of writing SQL queries.

Different DBAdapters will use require different dialects to work.

type Sqlite3Dialect

type Sqlite3Dialect struct{}

func (Sqlite3Dialect) DriverName

func (Sqlite3Dialect) DriverName() string

func (Sqlite3Dialect) Escape

func (Sqlite3Dialect) Escape(str string) string

func (Sqlite3Dialect) InsertMethod

func (Sqlite3Dialect) InsertMethod() InsertMethod

func (Sqlite3Dialect) Placeholder

func (Sqlite3Dialect) Placeholder(idx int) string

type SqlserverDialect

type SqlserverDialect struct{}

func (SqlserverDialect) DriverName

func (SqlserverDialect) DriverName() string

func (SqlserverDialect) Escape

func (SqlserverDialect) Escape(str string) string

func (SqlserverDialect) InsertMethod

func (SqlserverDialect) InsertMethod() InsertMethod

func (SqlserverDialect) Placeholder

func (SqlserverDialect) Placeholder(idx int) string

Jump to

Keyboard shortcuts

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