mysql

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DialectOption

type DialectOption func(dialect *MySQLDialect)

DialectOption is used to enable different options in dialect and thus tune SQL parser behavior

func SetANSIMode

func SetANSIMode(ansiMode bool) DialectOption

SetANSIMode allows to enable ANSI mode

func SetTableNameCaseSensitivity

func SetTableNameCaseSensitivity(sensitivity bool) DialectOption

SetTableNameCaseSensitivity allows to enable case sensitivity for table identifiers

type MySQLDialect

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

MySQLDialect dialect implementation for MySQL

func NewMySQLDialect

func NewMySQLDialect(options ...DialectOption) *MySQLDialect

NewMySQLDialect return new MySQLDialect, optionally configured with additional options

func (*MySQLDialect) IsCaseSensitiveTableName

func (dialect *MySQLDialect) IsCaseSensitiveTableName() bool

IsCaseSensitiveTableName return true if case sensitivity is enabled for table identifiers

func (*MySQLDialect) IsModeANSIOn

func (dialect *MySQLDialect) IsModeANSIOn() bool

IsModeANSIOn return true if ANSI mode used for mysql

func (*MySQLDialect) QuoteHandler

func (dialect *MySQLDialect) QuoteHandler() dialect.QuoteHandler

QuoteHandler return correct dialect according to sql mode

type QuoteHandler

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

QuoteHandler handler to handle quotes for MySQL according to modes https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_ansi_quotes https://dev.mysql.com/doc/refman/8.0/en/identifiers.html

func NewANSIQuoteHandler

func NewANSIQuoteHandler() *QuoteHandler

NewANSIQuoteHandler return handler with ANSI mode = true

func NewDefaultQuoteHandler

func NewDefaultQuoteHandler() *QuoteHandler

NewDefaultQuoteHandler return handler with default setting where ANSI mode = false

func (*QuoteHandler) GetIdentifierQuote

func (handler *QuoteHandler) GetIdentifierQuote() byte

GetIdentifierQuote return correct quote for identifier

func (*QuoteHandler) GetStringLiteralQuote

func (*QuoteHandler) GetStringLiteralQuote() byte

GetStringLiteralQuote return correct quote for string literal

func (*QuoteHandler) IsIdentifierQuote

func (handler *QuoteHandler) IsIdentifierQuote(quote byte) bool

IsIdentifierQuote return true if quote is correct quote for identifiers

func (*QuoteHandler) IsModeANSIOn

func (handler *QuoteHandler) IsModeANSIOn() bool

IsModeANSIOn return true if turned on ANSI quotes mode

func (*QuoteHandler) IsStringLiteralQuote

func (handler *QuoteHandler) IsStringLiteralQuote(quote byte) bool

IsStringLiteralQuote return true if quote is correct quote for string literal

func (*QuoteHandler) WrapIdentifier

func (handler *QuoteHandler) WrapIdentifier(identifier string) string

WrapIdentifier wrap identifier with correct quotes

func (*QuoteHandler) WrapStringLiteral

func (*QuoteHandler) WrapStringLiteral(literal string) string

WrapStringLiteral wrap literal with correct quotes

Jump to

Keyboard shortcuts

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