3 PRAGMA application_id = 0x5a504442;
4 PRAGMA user_version = 1;
6 -- should be faster with rowid due to the blob content
7 -- these are really just blobs of data
8 -- TODO copyright and license information should probably
11 hash text primary key,
18 -- information about packages
19 -- a package is identified by a package,version,release triple
20 create table packages (
21 -- primary key columns
23 version text, -- the upstream version string
24 release integer, -- the local release number
30 licenses text, -- hash of actual license? need table for more than one?
32 build_time integer default (strftime('%s', 'now')),
34 checksum text, -- checksum of package contents. null for incompleted packages
35 primary key (package,version,release)
40 -- files contained in a package
41 create table packagefiles (
47 path text, -- filesystem path
48 mode text, -- perms, use text for octal rep?
49 username text, -- name of owner
50 groupname text, -- group of owner
51 uid integer, -- numeric uid, generally ignored
52 gid integer, -- numeric gid, generally ignored
53 filetype varchar default 'r',
57 -- h hard link -- not supported
58 -- c character special and b device special files add dev number column
60 -- p fifos (i.e. pipe)
61 target text, -- link target for links
62 -- device file dev numbers, should probably be a separate table
65 hash text, -- null if no actual content, i.e. anything but a regular file
66 mtime integer, -- seconds since epoch, finer resolution probably not needed
67 primary key (package,version,release,path),
68 foreign key (package,version,release) references packages (package,version,release) on delete cascade
73 create table packagefiletags (
79 path text, -- filesystem path
81 primary key (package,version,release,path,tag)
86 create table elfinfo (
87 file text, -- hash of blob
89 foreign key (file) references files on delete cascade
92 -- TODO just elf information?
93 -- and just hash, not package?
94 create table elflibraries (
95 file text primary key,
97 foreign key (file) references files on delete cascade
102 create table elfneeded (
104 needed text, -- soname of dependency
105 primary key (file, needed),
106 foreign key (file) references files on delete cascade
111 -- package scripts: table of package, stage, file
112 create table scripts (
120 -- package dependencies: table of package, dependency, dep type (package, soname)
121 create table packagedeps (
125 required text, -- package name
126 -- following can be null for not checked
134 create table provides (
137 label text -- a capability label
140 create table requires (
143 label text -- a capability label
146 create table packagegroups (