redesign structure, add get endpoint

This commit is contained in:
katefort 2025-04-21 18:28:55 -05:00
parent 3dacf06005
commit a216cc14dd
14 changed files with 176 additions and 77 deletions

View file

@ -0,0 +1,14 @@
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
}