Help us shape the future of Go! Take the 2026 Go Developer Survey

mysql

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// contains filtered or unexported methods
}

type MySQLScrapper

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

func NewMySQLScrapper

func NewMySQLScrapper(ctx context.Context, conf *MySQLScrapperConf) (*MySQLScrapper, error)

func (*MySQLScrapper) Capabilities added in v0.10.6

func (e *MySQLScrapper) Capabilities() scrapper.Capabilities

func (*MySQLScrapper) Close

func (e *MySQLScrapper) Close() error

func (*MySQLScrapper) DialectType added in v0.1.8

func (e *MySQLScrapper) DialectType() string

func (*MySQLScrapper) EstimateQuery added in v0.16.0

func (e *MySQLScrapper) EstimateQuery(ctx context.Context, sql string) (*scrapper.QueryEstimate, error)

EstimateQuery is unsupported for now. MySQL's `EXPLAIN FORMAT=JSON` exposes per-table planner estimates (rows_examined_per_scan / rows_produced_per_join) but no single authoritative row or byte total, and the JSON shape differs between MySQL and MariaDB. Returning ErrUnsupported until a validation spike settles a reliable aggregation across both.

func (*MySQLScrapper) Executor added in v0.12.0

func (e *MySQLScrapper) Executor() *dwhexecmysql.MySQLExecutor

func (*MySQLScrapper) IsPermissionError added in v0.1.1

func (e *MySQLScrapper) IsPermissionError(err error) bool

func (*MySQLScrapper) QueryCatalog

func (e *MySQLScrapper) QueryCatalog(ctx context.Context) ([]*scrapper.CatalogColumnRow, error)

func (*MySQLScrapper) QueryCustomMetrics

func (e *MySQLScrapper) QueryCustomMetrics(ctx context.Context, sql string, args ...any) ([]*scrapper.CustomMetricsRow, error)

func (*MySQLScrapper) QueryDatabases

func (e *MySQLScrapper) QueryDatabases(ctx context.Context) ([]*scrapper.DatabaseRow, error)

func (*MySQLScrapper) QueryPlatformUsers added in v0.21.0

func (e *MySQLScrapper) QueryPlatformUsers(ctx context.Context) (*scrapper.PlatformUsers, error)

QueryPlatformUsers lists the server's accounts, one per user name.

The listing reads the mysql schema. When the role may not read it, that source is reported refused and information_schema is read instead, which shows only the connecting account and so is a limited source. information_schema only repeats a subset of the mysql schema, so it is read only then. A source that could not be read is refused, unavailable (a table or column this server version lacks) or failed, as its error says; the call itself fails only as CollectPlatformUsers decides. Roles and default roles are best effort.

func (*MySQLScrapper) QueryRoutines added in v0.23.0

func (e *MySQLScrapper) QueryRoutines(ctx context.Context) ([]*scrapper.RoutineRow, error)

func (*MySQLScrapper) QuerySchemas added in v0.14.5

func (e *MySQLScrapper) QuerySchemas(ctx context.Context) ([]*scrapper.SchemaRow, error)

QuerySchemas lists MySQL databases as schemas. MySQL has no separate schema level (a "schema" is a synonym for a database), so we map each MySQL database to a SchemaRow and use the host as the DatabaseRow.Database container — consistent with QueryTables.

func (*MySQLScrapper) QuerySegments

func (e *MySQLScrapper) QuerySegments(ctx context.Context, sql string, args ...any) ([]*scrapper.SegmentRow, error)

func (*MySQLScrapper) QueryShape added in v0.8.3

func (e *MySQLScrapper) QueryShape(ctx context.Context, sql string) ([]*scrapper.QueryShapeColumn, error)

func (*MySQLScrapper) QuerySqlDefinitions

func (e *MySQLScrapper) QuerySqlDefinitions(ctx context.Context) ([]*scrapper.SqlDefinitionRow, error)

func (*MySQLScrapper) QueryTableConstraints added in v0.9.0

func (e *MySQLScrapper) QueryTableConstraints(ctx context.Context) ([]*scrapper.TableConstraintRow, error)

func (*MySQLScrapper) QueryTableMetrics

func (e *MySQLScrapper) QueryTableMetrics(ctx context.Context, lastMetricsFetchTime time.Time) ([]*scrapper.TableMetricsRow, error)

func (*MySQLScrapper) QueryTables

func (e *MySQLScrapper) QueryTables(ctx context.Context, opts ...scrapper.QueryTablesOption) ([]*scrapper.TableRow, error)

func (*MySQLScrapper) RunRawQuery added in v0.13.7

func (*MySQLScrapper) SqlDialect added in v0.1.8

func (e *MySQLScrapper) SqlDialect() sqldialect.Dialect

func (*MySQLScrapper) ValidateConfiguration

func (e *MySQLScrapper) ValidateConfiguration(ctx context.Context) ([]string, error)

type MySQLScrapperConf

type MySQLScrapperConf struct {
	dwhexecmysql.MySQLConf
}

Jump to

Keyboard shortcuts

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