partsdb

electronic parts inventory
git clone https://git.e1e0.net/partsdb.git
Log | Files | Refs

commit a092e4de9ba70ccd11109995d299920c66a3e6f3
parent 96b0ec846b9b911c01d3ecb6bb79b03d0a7e2797
Author: Paco Esteban <paco@e1e0.net>
Date:   Sun, 14 Mar 2021 10:07:34 +0100

adapt serch query for dynamic listing

Diffstat:
Mdatabase.py | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/database.py b/database.py @@ -42,13 +42,18 @@ INSERT_PART_QUERY = """ """ GET_PART_QUERY = "SELECT * FROM parts WHERE id = ?" SEARCH_PARTS_QUERY = """ - SELECT * FROM parts + SELECT p.id, p.pn, p.manufacturer, p.description, + p.footprint, p.quantity, p.part_type, c.name as cname + FROM parts as p, categories as c + INNER JOIN categories + ON p.category_id = c.id WHERE pn LIKE '%'||?||'%' OR mpn LIKE '%'||?||'%' OR manufacturer LIKE '%'||?||'%' OR footprint LIKE '%'||?||'%' OR part_type LIKE '%'||?||'%' + GROUP BY p.id """