// Retrieve all compoundId's drugs returned by the query
Retrieve all compoundId's drugs returned by the query
// Retrieve all compoundId ' s drugs returned by the query
func Getdrugs(query string) ([]*Models.Drug, error) {
	fmt.Println("Getting drugs")
	rows, err := db.Query(query)
	if err != nil {
		return nil, fmt.Errorf("Error while querying sider (meddra): %v", err)
	}
	defer rows.Close()
	var results = make([]*Models.Drug, 0, 100)
	for rows.Next() {
		tmpMeddra := new(Models.Drug)
		err := rows.Scan(&tmpMeddra.STITCH_ID_SIDER)
		if err != nil {
			return results, err
		}
		results = append(results, tmpMeddra)
	}
	return results, nil
}
func Getdrugs ( query string ) ( [ ] * Models . Drug , error ) { fmt . Println ( " " ) rows , err := db . Query ( query ) if err != nil { return nil , fmt . Errorf ( " " , err ) } defer rows . Close ( ) var results = make ( [ ] * Models . Drug , 0 , 100 ) for rows . Next ( ) { tmpMeddra := new ( Models . Drug ) err := rows . Scan ( & tmpMeddra . STITCH_ID_SIDER ) if err != nil { return results , err } results = append ( results , tmpMeddra ) } return results , nil }
Retrieve all compoundId's drugs returned by the query
Retrieve all compoundId ' s drugs returned by the query