Documentation ¶
Overview ¶
Package utils holds generic utils about postgres instances
Index ¶
- func DBToFloat64(t interface{}) (float64, bool)
- func DBToString(t interface{}) (string, bool)
- func DBToUint64(t interface{}) (uint64, bool)
- func GetAllAccessibleDatabases(tx *sql.Tx, whereClause string) (databases []string, errors []error)
- func GetMajorVersion(pgData string) (int, error)
- func GetPgVersion(db *sql.DB) (*semver.Version, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBToFloat64 ¶
DBToFloat64 convert a dynamic value to float64s for Prometheus consumption. Null types are mapped to NaN. string and []byte types are mapped as NaN and !ok
func DBToString ¶
DBToString convert a dynamic type to string for Prometheus labels. Null types are mapped to empty strings.
func DBToUint64 ¶
DBToUint64 convert a dynamic type to uint64 for Prometheus consumption. Null types are mapped to 0. string and []byte types are mapped as 0 and !ok
func GetAllAccessibleDatabases ¶
GetAllAccessibleDatabases returns the list of all the accessible databases using the superuser
func GetMajorVersion ¶
GetMajorVersion read the PG_VERSION file in the data directory returning the major version of the database
Types ¶
This section is empty.