datasource

package
v0.2.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 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 paging.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 *zap.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 *zap.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 paging.Acceptor] interface.

type DataSourceMock

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

func (*DataSourceMock[T]) ReadSplit

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

type Factory added in v0.1.1

type Factory[T paging.Acceptor] interface {
	Make(
		logger *zap.Logger,
		dataSourceType api_common.EDataSourceKind,
	) (DataSource[T], error)
}

type TypeMapper added in v0.1.1

type TypeMapper interface {
	SQLTypeToYDBColumn(columnName, typeName string, rules *api_service_protos.TTypeMappingSettings) (*Ydb.Column, error)
}

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.
ydb
Package ydb contains code specific for YDB database.
Package ydb contains code specific for YDB database.
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