without rowid
;
+create view installedfiles as
+select PF.package, PF.version, PF.release,
+printf('%s-%s-%s', PF.package, PF.version, PF.release) as pkgid,
+PF.path, PF.hash, PF.filetype
+from packagefiles PF
+left join packages P
+on P.package = PF.package and P.version = PF.version and P.release = PF.release
+where
+P.status = 'installed'
+;
+
+create view installed_ref_count as
+select I.path, count(*) as refcount
+from installedfiles I
+group by I.path
+;
+
create table pathtags (
-- package id triple
package text,