//Gets id from compound name if it exists in allbase
Gets id from compound name if it exists in allbase
// Gets id from compound name if it exists in allbase
func NameToId(name string) (int, error) {
	db, err := ConnectDB()
	if err != nil {
		log.Fatalf("Couldn't connect to DB: %d", err)
	}
	var id int
	query := "SELECT id FROM compound WHERE name = ?"
	err = db.Get(&id, query, name)
	if err != nil {
		return 0, err
	}
	return id, err
}
func NameToId ( name string ) ( int , error ) { db , err := ConnectDB ( ) if err != nil { log . Fatalf ( " " , err ) } var id int query := " " err = db . Get ( & id , query , name ) if err != nil { return 0 , err } return id , err }
Gets id from compound name if it exists in allbase
Gets id from compound name if it exists in allbase
//whenever there's an error here we need to log desired compounds