iterator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

Iterator is an implementation of an iterator for ClickHouse.

func New

func New(ctx context.Context, driverName string, pos *Position, config config.SourceConfig) (*Iterator, error)

New creates a new instance of the iterator.

func (*Iterator) HasNext

func (iter *Iterator) HasNext(ctx context.Context) (bool, error)

HasNext returns a bool indicating whether the iterator has the next record to return or not.

func (*Iterator) Next

func (iter *Iterator) Next(context.Context) (sdk.Record, error)

Next returns the next record.

func (*Iterator) Stop

func (iter *Iterator) Stop() error

Stop stops iterators and closes database connection.

type Position

type Position struct {
	// LastProcessedValue represents the last processed value from ordering column.
	LastProcessedValue any `json:"lastProcessedValue"`
	// LatestSnapshotValue represents the most recent value of ordering column.
	LatestSnapshotValue any `json:"latestSnapshotValue"`
}

Position represents ClickHouse's position.

func ParseSDKPosition

func ParseSDKPosition(position sdk.Position) (*Position, error)

ParseSDKPosition parses sdk.Position and returns Position.

Jump to

Keyboard shortcuts

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