package database import "context" func (d *Database) FindProductIDByBarcode(system string, barcode string) (id int, err error) { ctx := context.Background() err = d.db.QueryOne(ctx, &id, "SELECT id FROM products WHERE system = ? AND barcode = ?", system, barcode) if err != nil { return -1, err } return }