Documentation
¶
Index ¶
- type MySQLSource
- func (m *MySQLSource) Ack(ctx context.Context, msg hermod.Message) error
- func (m *MySQLSource) Close() error
- func (m *MySQLSource) DiscoverColumns(ctx context.Context, table string) ([]hermod.ColumnInfo, error)
- func (m *MySQLSource) DiscoverDatabases(ctx context.Context) ([]string, error)
- func (m *MySQLSource) DiscoverTables(ctx context.Context) ([]string, error)
- func (m *MySQLSource) ExecuteSQL(ctx context.Context, query string) ([]map[string]any, error)
- func (m *MySQLSource) GetState() map[string]string
- func (m *MySQLSource) IsReady(ctx context.Context) error
- func (m *MySQLSource) Ping(ctx context.Context) error
- func (m *MySQLSource) Read(ctx context.Context) (hermod.Message, error)
- func (m *MySQLSource) Sample(ctx context.Context, table string) (hermod.Message, error)
- func (m *MySQLSource) SetInitialLoad(enabled bool)
- func (m *MySQLSource) SetLogger(logger hermod.Logger)
- func (m *MySQLSource) SetState(state map[string]string)
- func (m *MySQLSource) SetTables(tables ...string)
- func (m *MySQLSource) Snapshot(ctx context.Context, tables ...string) error
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 ¶
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 (*MySQLSource) GetState ¶
func (m *MySQLSource) GetState() map[string]string
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.