dbmanager

package
v0.0.0-...-5dd2f1f Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBManager

type DBManager struct {
	DB *sql.DB
}

DBManager holds the database connection pool.

func NewDBManager

func NewDBManager() (*DBManager, error)

NewDBManager creates a new DBManager.

func (*DBManager) BeginTransaction

func (manager *DBManager) BeginTransaction() (*sql.Tx, error)

BeginTransaction starts a new database transaction.

func (*DBManager) Close

func (manager *DBManager) Close() error

Close closes the database connection.

func (*DBManager) Delete

func (manager *DBManager) Delete(query string, args ...interface{}) (int64, error)

Delete executes a delete query and returns the number of affected rows.

func (*DBManager) Insert

func (manager *DBManager) Insert(query string, args ...interface{}) (int64, error)

Insert executes an insert query and returns the ID of the last inserted row.

func (*DBManager) Select

func (manager *DBManager) Select(query string, args ...interface{}) (*sql.Rows, error)

Select executes a select query and returns the rows.

func (*DBManager) Update

func (manager *DBManager) Update(query string, args ...interface{}) (int64, error)

Update executes an update query and returns the number of affected rows.

Jump to

Keyboard shortcuts

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