summaryrefslogtreecommitdiff
path: root/src/backend/querydb.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/querydb.py')
-rw-r--r--src/backend/querydb.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/querydb.py b/src/backend/querydb.py
index bc87123..b1dd257 100644
--- a/src/backend/querydb.py
+++ b/src/backend/querydb.py
@@ -6,19 +6,21 @@ def start(filter, cat='', pn='', desc=''):
'all': f'''SELECT
i.category AS cat,
i.name as pn,
+ i.slot as ist,
i.version as iv,
IFNULL(a.version, 'alien') AS av,
d.description AS desc
FROM local_packages AS i LEFT OUTER JOIN remote_packages as a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}
UNION
SELECT
a.category AS cat,
a.name as pn,
+ a.slot as ast,
IFNULL(i.version, 'None') AS iv,
a.version as av,
d.description AS desc
@@ -31,6 +33,7 @@ def start(filter, cat='', pn='', desc=''):
'installed': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version AS iv,
a.version as av,
d.description AS desc
@@ -38,12 +41,13 @@ def start(filter, cat='', pn='', desc=''):
LEFT JOIN remote_packages AS a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''',
'alien': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version as iv,
IFNULL(a.version, 'alien') AS av,
d.description AS desc
@@ -58,6 +62,7 @@ def start(filter, cat='', pn='', desc=''):
'available': f'''SELECT
a.category AS cat,
a.name AS pn,
+ a.slot as ast,
i.version as iv,
a.version AS av,
d.description AS desc
@@ -72,6 +77,7 @@ def start(filter, cat='', pn='', desc=''):
'upgradable': f'''SELECT
i.category AS cat,
i.name AS pn,
+ i.slot as ist,
i.version as iv,
a.version AS av,
d.description AS desc
@@ -79,7 +85,7 @@ def start(filter, cat='', pn='', desc=''):
INNER JOIN remote_packages AS a
ON i.category = a.category
AND i.name = a.name
- AND i.slot = i.slot
+ AND i.slot = a.slot
LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category
WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}
AND iv <> av'''