postgresql

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// wlogrus associated with the postgres db
	PsqlType = "postgres-db"

	MAX_BATCH_QUEUE       = 300
	MAX_EPOCH_BATCH_QUEUE = 1
)

Static postgres queries, for each modification in the tables, the table needs to be reseted

Functions

This section is empty.

Types

type PostgresDBService

type PostgresDBService struct {
	WriteChan chan pgx.Batch

	FinishSignalChan chan struct{}
	// contains filtered or unexported fields
}

func ConnectToDB

func ConnectToDB(ctx context.Context, url string, chanLength int, workerNum int) (*PostgresDBService, error)

Connect to the PostgreSQL Database and get the multithread-proof connection from the given url-composed credentials

func (*PostgresDBService) Close

func (p *PostgresDBService) Close()

Close the connection with the PostgreSQL

func (*PostgresDBService) DoneTasks

func (p *PostgresDBService) DoneTasks()

func (PostgresDBService) ExecuteBatch

func (p PostgresDBService) ExecuteBatch(batch pgx.Batch) error

type WriteTask

type WriteTask struct {
	QueryID  int
	ModelObj interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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