database

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package database provides database connection and management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(cfg *config.Config) (*sqlx.DB, error)

NewDatabase creates a new database connection

Types

type Database

type Database struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

Database wraps the SQL connection pool

func NewDB

func NewDB(cfg *config.Config, logger logging.Logger) (*Database, error)

NewDB creates a new database connection

func (*Database) Begin

func (db *Database) Begin() (*sqlx.Tx, error)

Begin starts a new transaction with detailed logging

func (*Database) Close

func (db *Database) Close() error

Close closes the database connection

Jump to

Keyboard shortcuts

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