Documentation ¶
Index ¶
- Variables
- func GetErrorF(errMsg string, err error) error
- type DB
- type PgxDB
- func (db *PgxDB) Close()
- func (db *PgxDB) DoesTableExist(schema, table string) (exist bool)
- func (db *PgxDB) ExecActionQuery(sql string, arguments ...interface{}) (rowsAffected int, err error)
- func (db *PgxDB) GetPGConn() (Conn *pgxpool.Pool, err error)
- func (db *PgxDB) GetQueryBool(sql string, arguments ...interface{}) (result bool, err error)
- func (db *PgxDB) GetQueryInt(sql string, arguments ...interface{}) (result int, err error)
- func (db *PgxDB) GetQueryString(sql string, arguments ...interface{}) (result string, err error)
- func (db *PgxDB) GetVersion() (result string, err error)
- func (db *PgxDB) Insert(sql string, arguments ...interface{}) (lastInsertId int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRecordFound = errors.New("record not found") ErrCouldNotBeCreated = errors.New("could not be created in DB") )
Functions ¶
Types ¶
type DB ¶
type DB interface { ExecActionQuery(sql string, arguments ...interface{}) (rowsAffected int, err error) Insert(sql string, arguments ...interface{}) (lastInsertId int, err error) GetQueryInt(sql string, arguments ...interface{}) (result int, err error) GetQueryBool(sql string, arguments ...interface{}) (result bool, err error) GetQueryString(sql string, arguments ...interface{}) (result string, err error) GetVersion() (result string, err error) GetPGConn() (Conn *pgxpool.Pool, err error) DoesTableExist(schema, table string) (exist bool) Close() }
DB is the interface for a simple table store.
type PgxDB ¶
func (*PgxDB) Close ¶
func (db *PgxDB) Close()
Close is a postgres helper function to close the connection to the database
func (*PgxDB) DoesTableExist ¶ added in v0.0.5
func (*PgxDB) ExecActionQuery ¶
func (db *PgxDB) ExecActionQuery(sql string, arguments ...interface{}) (rowsAffected int, err error)
ExecActionQuery is a postgres helper function for an action query, returning the numbers of rows affected
func (*PgxDB) GetQueryBool ¶
GetQueryBool is a postgres helper function for a query expecting an integer result
func (*PgxDB) GetQueryInt ¶
GetQueryInt is a postgres helper function for a query expecting an integer result
func (*PgxDB) GetQueryString ¶
func (*PgxDB) GetVersion ¶
Click to show internal directories.
Click to hide internal directories.