database

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database represents the SQLite database connection and operations

func NewDatabase

func NewDatabase(dbPath string, logger *log.Logger) (*Database, error)

NewDatabase creates a new database connection and initializes the schema

func (*Database) BeginTransaction

func (d *Database) BeginTransaction() (*sql.Tx, error)

BeginTransaction starts a new transaction

func (*Database) Close

func (d *Database) Close() error

Close closes the database connection

func (*Database) ExecuteInTransaction

func (d *Database) ExecuteInTransaction(fn func(*sql.Tx) error) error

ExecuteInTransaction executes a function within a transaction

func (*Database) GetDB

func (d *Database) GetDB() *sql.DB

GetDB returns the underlying sql.DB for direct operations

func (*Database) GetStats

func (d *Database) GetStats() (map[string]interface{}, error)

GetStats returns database statistics

func (*Database) HealthCheck

func (d *Database) HealthCheck() error

HealthCheck performs a basic health check on the database

Jump to

Keyboard shortcuts

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