datasource

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package datasource describes the interface that must be satisfied by any external data source accessible through the connector.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource[T utils.Acceptor] interface {
	// DescribeTable returns metadata about a table (or similar entity in non-relational data sources)
	// located within a particular database in a data source cluster.
	DescribeTable(
		ctx context.Context,
		logger log.Logger,
		request *api_service_protos.TDescribeTableRequest,
	) (*api_service_protos.TDescribeTableResponse, error)

	// ReadSplit is a main method for reading data from the table.
	ReadSplit(
		ctx context.Context,
		logger log.Logger,
		split *api_service_protos.TSplit,
		sink paging.Sink[T],
	)
}

DataSource is an abstraction over external data storage that is available for data and metadata extraction. All new data sources must implement this interface. The types of data extracted from the data source are parametrized via [T utils.Acceptor] interface.

type DataSourceFactory

type DataSourceFactory[T utils.Acceptor] interface {
	Make(
		logger log.Logger,
		dataSourceType api_common.EDataSourceKind,
	) (DataSource[T], error)
}

type DataSourceMock

type DataSourceMock[T utils.Acceptor] struct {
	mock.Mock
}

func (*DataSourceMock[T]) ReadSplit

func (m *DataSourceMock[T]) ReadSplit(
	_ context.Context,
	_ log.Logger,
	split *api_service_protos.TSplit,
	pagingWriter paging.Sink[T],
)

func (*DataSourceMock[T]) TypeMapper

func (m *DataSourceMock[T]) TypeMapper() utils.TypeMapper

Directories

Path Synopsis
Package rdbms contains generalized abstractions suitable for use with any relational database.
Package rdbms contains generalized abstractions suitable for use with any relational database.
clickhouse
Package clickhouse contains code specific for ClickHouse database.
Package clickhouse contains code specific for ClickHouse database.
postgresql
Package postgresql contains code specific for PostgreSQL database.
Package postgresql contains code specific for PostgreSQL database.
utils
Package utils contains helper types and functions that can be used by any relational data source.
Package utils contains helper types and functions that can be used by any relational data source.
Package s3 contains the implementation of S3 (Simple Storage Service) based data source
Package s3 contains the implementation of S3 (Simple Storage Service) based data source

Jump to

Keyboard shortcuts

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