mysql

package
v0.0.0-...-60c99de Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMyMariaDBPlugin

func NewMyMariaDBPlugin() *engine.Plugin

func NewMySQLPlugin

func NewMySQLPlugin() *engine.Plugin

func NewMySQLSQLBuilder

func NewMySQLSQLBuilder(db *gorm.DB, plugin gorm_plugin.GormPluginFunctions) gorm_plugin.SQLBuilderInterface

NewMySQLSQLBuilder creates a new MySQL-specific SQL builder

func NewTiDBPlugin

func NewTiDBPlugin() *engine.Plugin

Types

type MySQLPlugin

type MySQLPlugin struct {
	gorm_plugin.GormPlugin
}

func (*MySQLPlugin) BuildSkipConflictClause

func (p *MySQLPlugin) BuildSkipConflictClause(pkColumns []string) clause.OnConflict

BuildSkipConflictClause returns ON DUPLICATE KEY UPDATE pk = pk for MySQL. MySQL's GORM driver can't generate the id=id fallback without schema info when using .Table() with map records, so we provide explicit identity assignments.

func (*MySQLPlugin) CreateSQLBuilder

func (p *MySQLPlugin) CreateSQLBuilder(db *gorm.DB) gorm_plugin.SQLBuilderInterface

CreateSQLBuilder creates a MySQL-specific SQL builder

func (*MySQLPlugin) DB

func (p *MySQLPlugin) DB(config *engine.PluginConfig) (*gorm.DB, error)

func (*MySQLPlugin) FormatGeometryValue

func (p *MySQLPlugin) FormatGeometryValue(rawBytes []byte, columnType string) string

FormatGeometryValue formats MySQL geometry data for display. MySQL stores geometry as WKB with a 4-byte SRID prefix.

func (*MySQLPlugin) GetAllSchemasQuery

func (p *MySQLPlugin) GetAllSchemasQuery() string

func (*MySQLPlugin) GetColumnConstraints

func (p *MySQLPlugin) GetColumnConstraints(config *engine.PluginConfig, schema string, storageUnit string) (map[string]map[string]any, error)

GetColumnConstraints retrieves column constraints for MySQL/MariaDB tables

func (*MySQLPlugin) GetCreateTableQuery

func (p *MySQLPlugin) GetCreateTableQuery(db *gorm.DB, schema string, storageUnit string, columns []engine.Record) string

func (*MySQLPlugin) GetDatabases

func (p *MySQLPlugin) GetDatabases(config *engine.PluginConfig) ([]string, error)

func (*MySQLPlugin) GetForeignKeyRelationships

func (p *MySQLPlugin) GetForeignKeyRelationships(config *engine.PluginConfig, schema string, storageUnit string) (map[string]*engine.ForeignKeyRelationship, error)

func (*MySQLPlugin) GetGraphQueryDB

func (p *MySQLPlugin) GetGraphQueryDB(db *gorm.DB, schema string) *gorm.DB

func (*MySQLPlugin) GetLastInsertID

func (p *MySQLPlugin) GetLastInsertID(db *gorm.DB) (int64, error)

GetLastInsertID returns the most recently auto-generated ID using MySQL's LAST_INSERT_ID().

func (*MySQLPlugin) GetPlaceholder

func (p *MySQLPlugin) GetPlaceholder(index int) string

func (*MySQLPlugin) GetPrimaryKeyColQuery

func (p *MySQLPlugin) GetPrimaryKeyColQuery() string

func (*MySQLPlugin) GetSSLStatus

func (p *MySQLPlugin) GetSSLStatus(config *engine.PluginConfig) (*engine.SSLStatus, error)

GetSSLStatus queries MySQL/MariaDB to get the actual SSL status of the connection. Checks the Ssl_cipher session variable. Results are cached.

func (*MySQLPlugin) GetStorageUnitExistsQuery

func (p *MySQLPlugin) GetStorageUnitExistsQuery() string

func (*MySQLPlugin) GetSupportedOperators

func (p *MySQLPlugin) GetSupportedOperators() map[string]string

func (*MySQLPlugin) GetTableInfoQuery

func (p *MySQLPlugin) GetTableInfoQuery() string

func (*MySQLPlugin) GetTableNameAndAttributes

func (p *MySQLPlugin) GetTableNameAndAttributes(rows *sql.Rows) (string, []engine.Record)

func (*MySQLPlugin) MarkGeneratedColumns

func (p *MySQLPlugin) MarkGeneratedColumns(config *engine.PluginConfig, schema string, storageUnit string, columns []engine.Column) error

MarkGeneratedColumns detects MySQL generated columns (VIRTUAL or STORED) and marks them as IsComputed.

func (*MySQLPlugin) NormalizeType

func (p *MySQLPlugin) NormalizeType(typeName string) string

NormalizeType converts MySQL type aliases to their canonical form.

func (*MySQLPlugin) RawExecute

func (p *MySQLPlugin) RawExecute(config *engine.PluginConfig, query string, params ...any) (*engine.GetRowsResult, error)

type MySQLSQLBuilder

type MySQLSQLBuilder struct {
	*gorm_plugin.SQLBuilder
}

MySQLSQLBuilder extends the base SQLBuilder with MySQL-specific behavior

func (*MySQLSQLBuilder) GetTableQuery

func (msb *MySQLSQLBuilder) GetTableQuery(schema, table string) *gorm.DB

GetTableQuery creates a GORM query with the appropriate table reference for MySQL/MariaDB

Jump to

Keyboard shortcuts

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