pgxpool

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTransaction

func CreateTransaction(
	ctx context.Context,
	pool *pgxpool.Pool,
	fn TransactionFn,
) error

CreateTransaction creates a transaction for the database with context

Parameters:

  • ctx: The context for the transaction
  • pool: The pgxpool.Pool instance
  • fn: The function to execute within the transaction

Returns:

  • error: An error if the transaction fails, otherwise nil

Types

type TransactionFn added in v0.7.5

type TransactionFn func(ctx context.Context, tx pgx.Tx) error

TransactionFn is the function type for transactions with context

Jump to

Keyboard shortcuts

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