Documentation
¶
Index ¶
- func NewMyMariaDBPlugin() *engine.Plugin
- func NewMySQLPlugin() *engine.Plugin
- func NewMySQLSQLBuilder(db *gorm.DB, plugin gorm_plugin.GormPluginFunctions) gorm_plugin.SQLBuilderInterface
- func NewTiDBPlugin() *engine.Plugin
- type MySQLPlugin
- func (p *MySQLPlugin) BuildSkipConflictClause(pkColumns []string) clause.OnConflict
- func (p *MySQLPlugin) CreateSQLBuilder(db *gorm.DB) gorm_plugin.SQLBuilderInterface
- func (p *MySQLPlugin) DB(config *engine.PluginConfig) (*gorm.DB, error)
- func (p *MySQLPlugin) FormatGeometryValue(rawBytes []byte, columnType string) string
- func (p *MySQLPlugin) GetAllSchemasQuery() string
- func (p *MySQLPlugin) GetColumnConstraints(config *engine.PluginConfig, schema string, storageUnit string) (map[string]map[string]any, error)
- func (p *MySQLPlugin) GetCreateTableQuery(db *gorm.DB, schema string, storageUnit string, columns []engine.Record) string
- func (p *MySQLPlugin) GetDatabases(config *engine.PluginConfig) ([]string, error)
- func (p *MySQLPlugin) GetForeignKeyRelationships(config *engine.PluginConfig, schema string, storageUnit string) (map[string]*engine.ForeignKeyRelationship, error)
- func (p *MySQLPlugin) GetGraphQueryDB(db *gorm.DB, schema string) *gorm.DB
- func (p *MySQLPlugin) GetLastInsertID(db *gorm.DB) (int64, error)
- func (p *MySQLPlugin) GetPlaceholder(index int) string
- func (p *MySQLPlugin) GetPrimaryKeyColQuery() string
- func (p *MySQLPlugin) GetSSLStatus(config *engine.PluginConfig) (*engine.SSLStatus, error)
- func (p *MySQLPlugin) GetStorageUnitExistsQuery() string
- func (p *MySQLPlugin) GetSupportedOperators() map[string]string
- func (p *MySQLPlugin) GetTableInfoQuery() string
- func (p *MySQLPlugin) GetTableNameAndAttributes(rows *sql.Rows) (string, []engine.Record)
- func (p *MySQLPlugin) MarkGeneratedColumns(config *engine.PluginConfig, schema string, storageUnit string, ...) error
- func (p *MySQLPlugin) NormalizeType(typeName string) string
- func (p *MySQLPlugin) RawExecute(config *engine.PluginConfig, query string, params ...any) (*engine.GetRowsResult, error)
- type MySQLSQLBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMyMariaDBPlugin ¶
func NewMySQLPlugin ¶
func NewMySQLSQLBuilder ¶
func NewMySQLSQLBuilder(db *gorm.DB, plugin gorm_plugin.GormPluginFunctions) gorm_plugin.SQLBuilderInterface
NewMySQLSQLBuilder creates a new MySQL-specific SQL builder
func NewTiDBPlugin ¶
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 (*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 (*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 (*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