client

package
v0.0.0-...-43a04ef Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

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

DBClient is the implementation of DBClientInterface.

func (*DBClient) BeginTx

func (client *DBClient) BeginTx() (*sql.Tx, error)

BeginTx starts a new database transaction.

func (*DBClient) Close

func (client *DBClient) Close() error

Close closes the database connection.

func (*DBClient) ExecuteQuery

func (client *DBClient) ExecuteQuery(query model.DBQuery, args ...interface{}) ([]map[string]interface{}, error)

ExecuteQuery executes a SELECT query and returns the result as a slice of maps.

type DBClientInterface

type DBClientInterface interface {
	ExecuteQuery(query model.DBQuery, args ...interface{}) ([]map[string]interface{}, error)
	BeginTx() (*sql.Tx, error)
	Close() error
}

DBClientInterface defines the interface for database operations.

func NewDBClient

func NewDBClient(db *sql.DB) DBClientInterface

NewDBClient creates a new instance of DBClient with the provided database connection.

Jump to

Keyboard shortcuts

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