Documentation ¶
Index ¶
- Variables
- func SetConnectionStrings()
- type DBHandler
- func (dbService DBHandler) CreateConnection(connectionString string) (*pgx.Conn, error)
- func (dbService DBHandler) DbClose()
- func (dbService DBHandler) DbExecuteConflict(query string, args ...interface{}) error
- func (dbService DBHandler) DbExecuteQuery(query string) (int64, error)
- func (dbService DBHandler) DbExecuteScalar(query string, args ...interface{}) (pgx.Rows, error)
- func (dbService DBHandler) DbGetMultipleRow(query string, args ...interface{}) (pgx.Rows, error)
- func (dbService DBHandler) DbGetSingleRow(query string) (pgx.Row, error)
- func (dbService DBHandler) DbWriter(query string) 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) TxExecuteStmt(tx pgx.Tx, query string, args ...interface{}) (pgconn.CommandTag, 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) DbExecuteConflict ¶
DbExecuteConflict : To check foreign key violations...
func (DBHandler) DbExecuteQuery ¶
DbExecuteQuery : To execute queries.
func (DBHandler) DbExecuteScalar ¶
DbExecuteScalar : To insert/update records.
func (DBHandler) DbGetMultipleRow ¶
DbGetMultipleRow : To fetch multiple records.
func (DBHandler) DbGetSingleRow ¶
DbGetSingleRow : To get a single record.
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) TxExecuteStmt ¶
func (dbService DBHandler) TxExecuteStmt(tx pgx.Tx, query string, args ...interface{}) (pgconn.CommandTag, error)
TxExecuteStmt : Executes the Query. Usually an INSERT/UPDATE.
type DbIface ¶
type DbIface interface { TxBegin() (pgx.Tx, error) InitDbReader() (*pgx.Conn, error) InitDbWriter() (*pgx.Conn, error) CreateConnection(connstring string) (*pgx.Conn, error) TxQuery(tx pgx.Tx, query string) (pgx.Rows, error) DbGetMultipleRow(query string, args ...interface{}) (pgx.Rows, error) DbExecuteQuery(query string) (int64, error) DbExecuteScalar(query string, args ...interface{}) (pgx.Rows, error) DbExecuteConflict(query string, args ...interface{}) error DbWriter(query string) error TxExecuteStmt(tx pgx.Tx, query string, args ...interface{}) (pgconn.CommandTag, error) TxComplete(tx pgx.Tx) error DbClose() }
DbIface exposes db interconnection methods
Click to show internal directories.
Click to hide internal directories.