postgres

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchHandler

type BatchHandler func([]map[string]interface{}) error

type Chunk

type Chunk struct {
	Min interface{}
	Max interface{}
}

type Client

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

func Create

func Create(config config.DatabaseConnectionConfig) *Client

func (*Client) Close

func (client *Client) Close()

func (*Client) QuerySingleRow

func (client *Client) QuerySingleRow(ctx context.Context, query string) (map[string]interface{}, error)

QuerySingleRow mostly for testing purposes only

type PartitionType

type PartitionType = string

type TableChunkRepository

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

func CreateTableChunkRepository

func CreateTableChunkRepository(logger *zap.Logger, client *Client) *TableChunkRepository

func (*TableChunkRepository) CreateChunks

func (repo *TableChunkRepository) CreateChunks(ctx context.Context, schema string, table string, structure *TableStructure, parallelism int) ([]Chunk, error)

func (*TableChunkRepository) CreateChunksForPartition

func (repo *TableChunkRepository) CreateChunksForPartition(ctx context.Context, schema string, table string, partition TablePartition, structure *TableStructure, parallelism int) ([]Chunk, error)

type TableColumn

type TableColumn struct {
	ColumnName string
	Type       string
	Required   bool
	IsArray    bool
	Precision  int
	Scale      int
}

type TableDataFetcherRepository

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

func CreateTableDataFetcherRepository

func CreateTableDataFetcherRepository(logger *zap.Logger, client *Client) *TableDataFetcherRepository

func (*TableDataFetcherRepository) FetchChunk

func (repo *TableDataFetcherRepository) FetchChunk(ctx context.Context, schema string, table string, structure *TableStructure, batchSize int, chunk Chunk, handler BatchHandler) error

func (*TableDataFetcherRepository) FetchPartition

func (repo *TableDataFetcherRepository) FetchPartition(ctx context.Context, schema string, table string, partition TablePartition, batchSize int, handler BatchHandler) error

func (*TableDataFetcherRepository) FetchPartitionChunk

func (repo *TableDataFetcherRepository) FetchPartitionChunk(ctx context.Context, schema string, table string, partition TablePartition, structure *TableStructure, batchSize int, chunk Chunk, handler BatchHandler) error

func (*TableDataFetcherRepository) FetchTable

func (repo *TableDataFetcherRepository) FetchTable(ctx context.Context, schema string, table string, batchSize int, handler BatchHandler) error

type TablePartition

type TablePartition struct {
	ConstraintDefinition string
	// contains filtered or unexported fields
}

func (TablePartition) String

func (p TablePartition) String() string

type TablePartitionRepository

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

func CreateTablePartitionRepository

func CreateTablePartitionRepository(logger *zap.Logger, client *Client) *TablePartitionRepository

func (*TablePartitionRepository) GetHypertablePartitions

func (r *TablePartitionRepository) GetHypertablePartitions(ctx context.Context, schema string, table string) ([]TablePartition, error)

GetHypertablePartitions partitions == chunks

func (*TablePartitionRepository) GetTablePartitions

func (r *TablePartitionRepository) GetTablePartitions(ctx context.Context, schema string, table string) ([]TablePartition, error)

type TableStructure

type TableStructure struct {
	Columns         []TableColumn
	PartitionColumn *TableColumn // optional
}

type TableStructureRepository

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

func CreateTableStructureRepository

func CreateTableStructureRepository(logger *zap.Logger, client *Client) *TableStructureRepository

func (*TableStructureRepository) ExtractTableStructure

func (repo *TableStructureRepository) ExtractTableStructure(ctx context.Context, schema string, table string, partitionColumnName string) (*TableStructure, error)

Jump to

Keyboard shortcuts

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