datasource

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 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 cluster of a certain type.
	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,
		request *api_service_protos.TReadSplitsRequest,
		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,
	_ *api_service_protos.TReadSplitsRequest,
	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.
ms_sql_server
Package ms_sql_server contains code specific for Microsoft SQL Server database.
Package ms_sql_server contains code specific for Microsoft SQL Server database.
oracle
Package oracle contains code specific for Oracle database.
Package oracle contains code specific for Oracle 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