mysql

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

+marmot:name=MySQL +marmot:description=This plugin discovers databases and tables from MySQL instances. +marmot:status=experimental +marmot:features=Assets, Lineage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	plugin.BaseConfig `json:",inline"`

	Host     string `json:"host" description:"MySQL server hostname or IP address" validate:"required"`
	Port     int    `json:"port" description:"MySQL server port" default:"3306" validate:"omitempty,min=1,max=65535"`
	User     string `json:"user" description:"Username for authentication" validate:"required"`
	Password string `json:"password" description:"Password for authentication" sensitive:"true"`
	Database string `json:"database" description:"Database name to connect to" validate:"required"`
	TLS      string `` /* 156-byte string literal not displayed */

	IncludeColumns      bool           `json:"include_columns" description:"Whether to include column information in table metadata" default:"true"`
	IncludeRowCounts    bool           `json:"include_row_counts" description:"Whether to include approximate row counts" default:"true"`
	DiscoverForeignKeys bool           `json:"discover_foreign_keys" description:"Whether to discover foreign key relationships" default:"true"`
	TableFilter         *plugin.Filter `json:"table_filter,omitempty" description:"Filter configuration for tables"`
}

Config for MySQL plugin +marmot:config

type MySQLColumnFields

type MySQLColumnFields struct {
	ColumnName      string `json:"column_name" metadata:"column_name" description:"Column name"`
	DataType        string `json:"data_type" metadata:"data_type" description:"Data type"`
	ColumnType      string `json:"column_type" metadata:"column_type" description:"Full column type definition"`
	IsNullable      bool   `json:"is_nullable" metadata:"is_nullable" description:"Whether null values are allowed"`
	ColumnDefault   string `json:"column_default" metadata:"column_default" description:"Default value"`
	IsPrimaryKey    bool   `json:"is_primary_key" metadata:"is_primary_key" description:"Whether column is part of primary key"`
	IsAutoIncrement bool   `json:"is_auto_increment" metadata:"is_auto_increment" description:"Whether column auto-increments"`
	CharacterSet    string `json:"character_set" metadata:"character_set" description:"Character set"`
	Collation       string `json:"collation" metadata:"collation" description:"Collation"`
	Comment         string `json:"comment" metadata:"comment" description:"Column comment/description"`
}

MySQLColumnFields represents MySQL column-specific metadata fields +marmot:metadata

type MySQLFields

type MySQLFields struct {
	Host        string `json:"host" metadata:"host" description:"MySQL server hostname"`
	Port        int    `json:"port" metadata:"port" description:"MySQL server port"`
	Database    string `json:"database" metadata:"database" description:"Database name"`
	Schema      string `json:"schema" metadata:"schema" description:"Schema name"`
	TableName   string `json:"table_name" metadata:"table_name" description:"Object name"`
	ObjectType  string `json:"object_type" metadata:"object_type" description:"Object type (table, view)"`
	Engine      string `json:"engine" metadata:"engine" description:"Storage engine"`
	Collation   string `json:"collation" metadata:"collation" description:"Table collation"`
	RowCount    int64  `json:"row_count" metadata:"row_count" description:"Approximate row count"`
	DataLength  int64  `json:"data_length" metadata:"data_length" description:"Data size in bytes"`
	IndexLength int64  `json:"index_length" metadata:"index_length" description:"Index size in bytes"`
	Created     string `json:"created" metadata:"created" description:"Creation timestamp"`
	Updated     string `json:"updated" metadata:"updated" description:"Last update timestamp"`
	Comment     string `json:"comment" metadata:"comment" description:"Object comment/description"`
	Charset     string `json:"charset" metadata:"charset" description:"Character set"`
	Version     string `json:"version" metadata:"version" description:"MySQL version"`
}

MySQLFields represents MySQL-specific metadata fields +marmot:metadata

type MySQLForeignKeyFields

type MySQLForeignKeyFields struct {
	ConstraintName string `json:"constraint_name" metadata:"constraint_name" description:"Foreign key constraint name"`
	SourceSchema   string `json:"source_schema" metadata:"source_schema" description:"Schema of the referencing table"`
	SourceTable    string `json:"source_table" metadata:"source_table" description:"Name of the referencing table"`
	SourceColumn   string `json:"source_column" metadata:"source_column" description:"Column in the referencing table"`
	TargetSchema   string `json:"target_schema" metadata:"target_schema" description:"Schema of the referenced table"`
	TargetTable    string `json:"target_table" metadata:"target_table" description:"Name of the referenced table"`
	TargetColumn   string `json:"target_column" metadata:"target_column" description:"Column in the referenced table"`
	UpdateRule     string `json:"update_rule" metadata:"update_rule" description:"Update rule (CASCADE, RESTRICT, etc.)"`
	DeleteRule     string `json:"delete_rule" metadata:"delete_rule" description:"Delete rule (CASCADE, RESTRICT, etc.)"`
}

MySQLForeignKeyFields represents MySQL foreign key relationship fields +marmot:metadata

type Source

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

func (*Source) Discover

func (s *Source) Discover(ctx context.Context, pluginConfig plugin.RawPluginConfig) (*plugin.DiscoveryResult, error)

func (*Source) Validate

func (s *Source) Validate(rawConfig plugin.RawPluginConfig) (plugin.RawPluginConfig, error)

Jump to

Keyboard shortcuts

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