Documentation ¶
Index ¶
- Variables
- func SetConnectionStrings()
- type DBHandler
- func (dbService DBHandler) CreateConnection(connectionString string) (*pgx.Conn, error)
- func (dbService DBHandler) DbClose()
- func (dbService DBHandler) DbExecuteScalar(query string, args ...interface{}) (pgx.Rows, error)
- func (dbService DBHandler) DbExecuteScalarReturningID(query string, args ...interface{}) (int, error)
- func (dbService DBHandler) DbQuery(query string, responseRowID *int, args ...interface{}) error
- func (dbService DBHandler) InitDbReader() (*pgx.Conn, error)
- func (dbService DBHandler) InitDbWriter() (*pgx.Conn, error)
- func (dbService DBHandler) TxBegin() (pgx.Tx, error)
- func (dbService DBHandler) TxComplete(tx pgx.Tx) error
- func (dbService DBHandler) TxCreateTempTable(tx pgx.Tx, tblName string, sql string) (*pgconn.StatementDescription, error)
- func (dbService DBHandler) TxQuery(tx pgx.Tx, query string) (pgx.Rows, error)
- type DbIface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DB : for the database at the global space DB *pgx.Conn // ReaderConnectionString ... ReaderConnectionString string // WriterConnectionString ... WriterConnectionString string )
Functions ¶
Types ¶
type DBHandler ¶
type DBHandler struct {
DatabaseService DbIface
}
DBHandler provides the class implementation for DbIface interface
func (DBHandler) CreateConnection ¶
CreateConnection : Creates the Connection
func (DBHandler) DbClose ¶
func (dbService DBHandler) DbClose()
DbClose : Close the DB connectivity.
func (DBHandler) DbExecuteScalar ¶
DbExecuteScalar : To insert/update records.
func (DBHandler) DbExecuteScalarReturningID ¶
func (dbService DBHandler) DbExecuteScalarReturningID(query string, args ...interface{}) (int, error)
DbExecuteScalarReturningID : To insert/update records returns ids.
func (DBHandler) InitDbReader ¶
InitDbReader : for the database at the global space
func (DBHandler) InitDbWriter ¶
InitDbWriter : for the database at the global space
func (DBHandler) TxComplete ¶
TxComplete : Save Changes to the Database.
func (DBHandler) TxCreateTempTable ¶
func (dbService DBHandler) TxCreateTempTable(tx pgx.Tx, tblName string, sql string) (*pgconn.StatementDescription, error)
TxCreateTempTable : To execute a query and fetch rows. This will typically perform an insert & select (or) a plain select.
type DbIface ¶
type DbIface interface { DbExecuteScalar(query string, args ...interface{}) (pgx.Rows, error) DbQuery(query string, responseRowID *int, args ...interface{}) error DbExecuteScalarReturningID(query string, args ...interface{}) (int, error) DbClose() TxBegin() (pgx.Tx, error) TxQuery(tx pgx.Tx, query string) (pgx.Rows, error) TxComplete(tx pgx.Tx) error TxCreateTempTable(tx pgx.Tx, tblName string, sql string) (*pgconn.StatementDescription, error) }
DbIface exposes db interconnection methods
Click to show internal directories.
Click to hide internal directories.