Пример #1
0
//query the struct result by query string and arguments.
func DbQueryS(db *sql.DB, res interface{}, query string, args ...interface{}) error {
	mres, err := DbQuery(db, query, args...)
	if err != nil {
		return err
	}
	util.Ms2Ss(mres, res)
	return nil
}
Пример #2
0
func DbQueryS2(tx *sql.Tx, res interface{}, query string, args ...interface{}) error {
	mres, err := DbQuery2(tx, query, args...)
	if err != nil {
		return err
	}
	util.Ms2Ss(mres, res)
	return nil
}