database

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase(databaseURI string) (*sql.DB, error)

ConnectToDatabase establishes a connection to a PostgreSQL database Configures connection pooling and verifies connectivity Returns the database handle or an error if the connection fails

func Transaction added in v1.1.4

func Transaction(database *sql.DB, operation TransactionFunction) (err error)

Transaction executes a database transaction with robust panic handling, consistent timestamps, and enhanced logging for debugging.

Types

type TransactionFunction added in v1.1.3

type TransactionFunction func(transaction *sql.Tx) error

TransactionFunction defines the signature for the transactional operation.

Jump to

Keyboard shortcuts

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