db

package
v0.0.0-...-e45628a Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectPool

func ConnectPool(ctx context.Context, host, port, user, password, dbname string, isUnixSocket bool) (*pgxpool.Pool, error)

func DataConsumer

func DataConsumer(ctx context.Context, pool *pgxpool.Pool, tableName string, columns []string, dataChan <-chan []interface{}, wg *sync.WaitGroup)

DataConsumer receives data from a channel and writes it to the target database.

func DataProducer

func DataProducer(ctx context.Context, pool *pgxpool.Pool, tableName string, dataChan chan<- []interface{}, wg *sync.WaitGroup)

DataProducer fetches data from the specified table and sends it to a channel.

func FetchColumns

func FetchColumns(ctx context.Context, pool *pgxpool.Pool, tableName string) ([]string, error)

FetchColumns function fetches column names for the given table from the source database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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