Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEntityColumns ¶
func GetEntityColumns(entity interface{}) []interface{}
GetEntityColumns receives a POINTER on entity (NOT A VALUE), parses is using reflection and returns a slice of columns for database/sql Query() method purpose for retrieving data from result rows. https://stackoverflow.com/questions/56525471/how-to-use-rows-scan-of-gos-database-sql
Types ¶
type CommonDBConnector ¶
func New ¶
func New(dbConfig config.DatabaseConfig, logger *slog.Logger) (*CommonDBConnector, error)
func (*CommonDBConnector) CloseConnection ¶
func (connector *CommonDBConnector) CloseConnection()
func (*CommonDBConnector) Connect ¶
func (connector *CommonDBConnector) Connect() error
func (*CommonDBConnector) GetConnection ¶
func (connector *CommonDBConnector) GetConnection() *sql.DB
func (*CommonDBConnector) GetTransaction ¶
func (connector *CommonDBConnector) GetTransaction() (*sql.Tx, error)
Click to show internal directories.
Click to hide internal directories.