mysql

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLSource

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

MySQLSource implements the hermod.Source interface for MySQL CDC.

func NewMySQLSource

func NewMySQLSource(connString string, useCDC bool) *MySQLSource

func (*MySQLSource) Ack

func (m *MySQLSource) Ack(ctx context.Context, msg hermod.Message) error

Ack moves the position a restart resumes from.

Snapshot messages carry no binlog position and move nothing — they did not come from the binlog. What records a finished backfill is initialLoadComplete, which GetState reports separately.

The position only ever moves forward, matching the PostgreSQL source's handling of the LSN: out-of-order acks cannot drag it backwards.

func (*MySQLSource) Close

func (m *MySQLSource) Close() error

func (*MySQLSource) DiscoverColumns

func (m *MySQLSource) DiscoverColumns(ctx context.Context, table string) ([]hermod.ColumnInfo, error)

func (*MySQLSource) DiscoverDatabases

func (m *MySQLSource) DiscoverDatabases(ctx context.Context) ([]string, error)

func (*MySQLSource) DiscoverTables

func (m *MySQLSource) DiscoverTables(ctx context.Context) ([]string, error)

func (*MySQLSource) ExecuteSQL

func (m *MySQLSource) ExecuteSQL(ctx context.Context, query string) ([]map[string]any, error)

func (*MySQLSource) GetState

func (m *MySQLSource) GetState() map[string]string

func (*MySQLSource) IsReady

func (m *MySQLSource) IsReady(ctx context.Context) error

func (*MySQLSource) Ping

func (m *MySQLSource) Ping(ctx context.Context) error

func (*MySQLSource) Read

func (m *MySQLSource) Read(ctx context.Context) (hermod.Message, error)

func (*MySQLSource) Sample

func (m *MySQLSource) Sample(ctx context.Context, table string) (hermod.Message, error)

func (*MySQLSource) SetInitialLoad

func (m *MySQLSource) SetInitialLoad(enabled bool)

SetInitialLoad asks for a one-time backfill of the watched tables before the binlog is read.

It runs only when the source has no record of having run before, so enabling it on a workflow that is already streaming does nothing until that record is cleared. See initialLoadComplete for what the record is.

func (*MySQLSource) SetLogger

func (m *MySQLSource) SetLogger(logger hermod.Logger)

func (*MySQLSource) SetState

func (m *MySQLSource) SetState(state map[string]string)

func (*MySQLSource) SetTables

func (m *MySQLSource) SetTables(tables ...string)

SetTables scopes the initial load to the named tables. Without it the backfill covers every table DiscoverTables reports.

func (*MySQLSource) Snapshot

func (m *MySQLSource) Snapshot(ctx context.Context, tables ...string) error

Jump to

Keyboard shortcuts

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