// GetAgeModelData does the search and modifies the results struct pointer // Not placed in the above function to allow this to be called by stand along apps like ocdBulk func GetAgeModelData(db *sqlx.DB, sqlstring string, results **[]AgeModel) { db.MapperFunc(strings.ToUpper) err := db.Select(*results, sqlstring) if err != nil { log.Printf(`Error v2 with: %s`, err) } }
func GetMasterStatus(db *sqlx.DB) (MasterStatus, error) { db.MapperFunc(strings.Title) ms := MasterStatus{} err := db.Get(&ms, "SHOW MASTER STATUS") return ms, err }
func GetAllSlavesStatus(db *sqlx.DB) ([]SlaveStatus, error) { db.MapperFunc(strings.Title) ss := []SlaveStatus{} err := db.Select(&ss, "SHOW ALL SLAVES STATUS") return ss, err }
func GetSlaveStatus(db *sqlx.DB) (SlaveStatus, error) { db.MapperFunc(strings.Title) ss := SlaveStatus{} err := db.Get(&ss, "SHOW SLAVE STATUS") return ss, err }
func GetPrivileges(db *sqlx.DB, user string) (Privileges, error) { db.MapperFunc(strings.Title) priv := Privileges{} err := db.Get(&priv, "SELECT Select_priv, Process_priv, Super_priv, Repl_slave_priv, Repl_client_priv FROM mysql.user WHERE user = ?", user) return priv, err }