postgres

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchema

func GetSchema(ctx context.Context, db *pgxpool.Pool, table string) (*schema.Schema, error)

GetSchema introspects the PostgreSQL database to get the schema of a table.

Types

type PostgresAdapter

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

func NewPostgresAdapter

func NewPostgresAdapter() *PostgresAdapter

func (*PostgresAdapter) ApplySchema

func (a *PostgresAdapter) ApplySchema(ctx context.Context, s *schema.Schema) error

func (*PostgresAdapter) Close

func (a *PostgresAdapter) Close() error

func (*PostgresAdapter) Connect

func (a *PostgresAdapter) Connect(ctx context.Context, cfg config.DBConfig) error

func (*PostgresAdapter) Partitions

func (a *PostgresAdapter) Partitions(ctx context.Context, table string, n int) ([]adapter.Partition, error)

func (*PostgresAdapter) ReadPartition

func (a *PostgresAdapter) ReadPartition(ctx context.Context, p adapter.Partition, ch chan<- *record.Record, errCh chan<- error)

func (*PostgresAdapter) Schema

func (a *PostgresAdapter) Schema(ctx context.Context, table string) (*schema.Schema, error)

func (*PostgresAdapter) WriteBatch

func (a *PostgresAdapter) WriteBatch(ctx context.Context, batch []*record.Record) (int, error)

type Reader

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

Reader handles parallel reading from PostgreSQL.

func NewReader

func NewReader(db *pgxpool.Pool) *Reader

func (*Reader) Partitions

func (r *Reader) Partitions(ctx context.Context, table string, n int) ([]adapter.Partition, error)

func (*Reader) ReadPartition

func (r *Reader) ReadPartition(ctx context.Context, p adapter.Partition, ch chan<- *record.Record, errCh chan<- error)

type Writer

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

Writer handles bulk writing to PostgreSQL using the COPY protocol.

func NewWriter

func NewWriter(db *pgxpool.Pool, table string) *Writer

func (*Writer) ApplySchema

func (w *Writer) ApplySchema(ctx context.Context, s *schema.Schema) error

func (*Writer) WriteBatch

func (w *Writer) WriteBatch(ctx context.Context, batch []*record.Record) (int, error)

Jump to

Keyboard shortcuts

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