diff options
Diffstat (limited to 'gentoobrowse/views/package.xml')
-rw-r--r-- | gentoobrowse/views/package.xml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml new file mode 100644 index 0000000..8544123 --- /dev/null +++ b/gentoobrowse/views/package.xml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<block xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="../datasources/postgres.xml" /> + <sqlview name="summary" recordname="package" datasource="postgres"> + <sql> + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname + FROM packages p, categories c + WHERE c.name = ? + AND p.name = ? + AND p.categoryid = c.categoryid + </sql> + <parameters> + <param bind="0" id="1" source="uri" /> + <param bind="1" id="2" source="uri" /> + </parameters> + <sqlview name="versions" recordname="version" datasource="postgres"> + <sql> + SELECT e.ebuildid, e.version + FROM ebuilds e + WHERE e.packageid = ? + ORDER BY versioninst desc + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="packageUrls" recordname="url" datasource="postgres"> + <sql> + SELECT pu.url + FROM package_urls pu + WHERE pu.packageid = ? + ORDER BY pu.url + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="versionUses" recordname="use" datasource="postgres"> + <sql> + SELECT u.* + FROM ebuilds e, ebuild_uses u + WHERE e.packageid = ? + AND e.ebuildid = u.ebuildid + ORDER BY version + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="versionArchs" recordname="arch" datasource="postgres"> + <sql> + SELECT a.* + FROM ebuilds e, ebuild_archs a + WHERE e.packageid = ? + AND e.ebuildid = a.ebuildid + ORDER BY version + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + <sqlview name="deps" recordname="package" datasource="postgres"> + <sql> + SELECT distinct cd.name AS catname, pd.name AS pkgname, pd.description + FROM ebuilds e, ebuild_deps d, packages pd, categories cd + WHERE e.packageid = ? + AND d.ebuildid = e.ebuildid + AND pd.packageid = d.packageid + AND pd.categoryid = cd.categoryid + ORDER BY cd.name, pd.name + </sql> + <parameters> + <param bind="0" id="packageid" source="parent" /> + </parameters> + </sqlview> + </sqlview> +</block> |