Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Partition ¶
Partition represents a slice of a table or collection that can be read in parallel.
type SourceAdapter ¶
type SourceAdapter interface {
// Connect validates credentials and opens a connection pool.
Connect(ctx context.Context, cfg config.DBConfig) error
// Partitions splits the source table/collection into N roughly equal
// partitions for parallel reading. Returns partition descriptors.
Partitions(ctx context.Context, table string, n int) ([]Partition, error)
// ReadPartition streams records from a single partition into ch.
// It must respect ctx cancellation and send on errCh on fatal errors.
ReadPartition(ctx context.Context, p Partition, ch chan<- *record.Record, errCh chan<- error)
// Schema returns the canonical schema for a table/collection.
Schema(ctx context.Context, table string) (*schema.Schema, error)
// Close releases all connections.
Close() error
}
SourceAdapter defines the interface for databases we read from.
type TargetAdapter ¶
type TargetAdapter interface {
// Connect validates credentials and opens a connection pool.
Connect(ctx context.Context, cfg config.DBConfig) error
// WriteBatch atomically (best-effort) writes a batch of records.
// Returns the count of successfully written records.
WriteBatch(ctx context.Context, batch []*record.Record) (int, error)
// ApplySchema creates or alters the target table to match s.
ApplySchema(ctx context.Context, s *schema.Schema) error
// Close releases all connections.
Close() error
}
TargetAdapter defines the interface for databases we write to.
Click to show internal directories.
Click to hide internal directories.