sqlmysql

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MysqlTable

func MysqlTable(sql string, compatCollation bool) (string, error)

func OBTable

func OBTable(sql string) (string, error)

Types

type MySQLExtraData

type MySQLExtraData struct {
	Delimiter      string
	InDelimiterDef bool
	EndMarks       map[string]struct{}
	// CompoundDepth 函数/存储过程/触发器体 BEGIN..END 的嵌套深度。
	// 导出文件(SHOW CREATE 输出)通常不带 DELIMITER 指令,函数体内的分号
	// 不能当作语句结束,只能靠 BEGIN/END 深度跟踪判定块边界
	CompoundDepth int
	// CaseDepth 复合块内尚未闭合的 CASE 表达式个数。
	// CASE 表达式以裸 END 收尾,裸 END 须优先闭合 CASE 而非外层 BEGIN
	CaseDepth int
	// contains filtered or unexported fields
}

MySQLExtraData implements the ExtraData interface for MySQL

func (*MySQLExtraData) IsBlockEnd

func (e *MySQLExtraData) IsBlockEnd(line string) bool

type MySQLType

type MySQLType int

MySQLType implements the SQLType interface for MySQL

const (
	MySQLTypeUnknown MySQLType = iota
	MySQLTypeSelect
	MySQLTypeInsert
	MySQLTypeUpdate
	MySQLTypeDelete
	MySQLTypeCreateTable
	MySQLTypeCreateIndex
	MySQLTypeCreateView
	MySQLTypeCreateFunction
	MySQLTypeCreateProcedure
	MySQLTypeCreateTrigger
	MySQLTypeDrop
	MySQLTypeAlter
	MySQLTypeTransaction
	MySQLTypeOther
)

func (MySQLType) AsInt

func (t MySQLType) AsInt() int

AsInt returns the integer representation of the SQL type

func (MySQLType) IsBlock

func (t MySQLType) IsBlock() bool

IsBlock determines if the SQL type represents a block statement

func (MySQLType) IsNull

func (t MySQLType) IsNull() bool

func (MySQLType) String

func (t MySQLType) String() string

String returns the string representation of the SQL type

Jump to

Keyboard shortcuts

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