func query2(db *core.DB, sqlStr string, params ...interface{}) (resultsSlice []map[string]string, err error) { s, err := db.Prepare(sqlStr) if err != nil { return nil, err } defer s.Close() rows, err := s.Query(params...) if err != nil { return nil, err } defer rows.Close() return rows2Strings(rows) }
func query3WithDateFormat(db *core.DB, dateFormat string, sqlStr string, params ...interface{}) (resultsSlice []map[string]interface{}, err error) { s, err := db.Prepare(sqlStr) if err != nil { return nil, err } defer s.Close() rows, err := s.Query(params...) if err != nil { return nil, err } defer rows.Close() return rows2mapObjectsWithDateFormat(rows, dateFormat) }
func queryByMap(db *core.DB, sqlStr string, params interface{}) (resultsSlice []map[string]interface{}, err error) { s, err := db.Prepare(sqlStr) if err != nil { return nil, err } defer s.Close() rows, err := s.QueryMap(params) if err != nil { return nil, err } defer rows.Close() return rows2mapObjects(rows) }