common

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurePGXLogger

func ConfigurePGXLogger(connConfig *pgx.ConnConfig)

ConfigurePGXLogger sets zerolog global logger into the connection pool configuration, and maps info level events to debug, as they are rather verbose for SpiceDB's info level

func ConvertToWriteConstraintError

func ConvertToWriteConstraintError(livingTupleConstraint string, err error) error

ConvertToWriteConstraintError converts the given Postgres error into a CreateRelationshipExistsError if applicable. If not applicable, returns nils.

func NewPGXExecutor

func NewPGXExecutor(txSource TxFactory) common.ExecuteQueryFunc

NewPGXExecutor creates an executor that uses the pgx library to make the specified queries.

Types

type TxFactory

type TxFactory func(context.Context) (pgx.Tx, common.TxCleanupFunc, error)

TxFactory returns a transaction, cleanup function, and any errors that may have occurred when building the transaction.

Jump to

Keyboard shortcuts

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