postgres

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

README

Postgres Backend

Connection pool

NewPostgresOptions starts the pgx pool with 16 connections (DefaultMaxConns). This is a starting point for the default worker parallelism; set options.PgOptions.MaxConns explicitly for the deployment's worker count and PostgreSQL connection budget.

Testing

By default, the postgres tests are skipped. To run the tests, set the environment variable POSTGRES_ENABLED to true before running the tests and have a postgres server running on localhost:5432 with a database named postgres and a user postgres with password postgres.

Documentation

Index

Constants

View Source
const DefaultMaxConns int32 = 16

DefaultMaxConns is the initial PostgreSQL pool size. Increase it to match the expected worker concurrency and the database connection budget.

Variables

This section is empty.

Functions

func NewPostgresBackend

func NewPostgresBackend(opts *PostgresOptions, logger backend.Logger) backend.Backend

NewPostgresBackend creates a new postgres-based Backend object.

Types

type PostgresOptions

type PostgresOptions struct {
	PgOptions           *pgxpool.Config
	WorkflowLockTimeout time.Duration
	ActivityLockTimeout time.Duration
}

func NewPostgresOptions

func NewPostgresOptions(host string, port uint16, database string, user string, password string) *PostgresOptions

NewPostgresOptions creates a new options object for the postgres backend provider.

Jump to

Keyboard shortcuts

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