[Rpm-maint] [rpm-software-management/rpm] How can I find details on the binary representation of the RPM DB? (Discussion #2211)

Shane Bishop notifications at github.com
Fri Sep 30 20:33:16 UTC 2022


I found that, starting with RPM 4.16, RPM uses an SQLite database ([reference](https://fedoraproject.org/wiki/Changes/RPM-4.16#Detailed_Description)).

>From querying my local table, I see there are the following tables:
```
sqlite> .tables
Basenames             Name                  Sigmd5              
Conflictname          Obsoletename          Suggestname         
Dirnames              Packages              Supplementname      
Enhancename           Providename           Transfiletriggername
Filetriggername       Recommendname         Triggername         
Group                 Requirename         
Installtid            Sha1header          
```

I can look at the schemas of individual tables like so:
```
sqlite> .schema Name
CREATE TABLE IF NOT EXISTS 'Name' (key 'TEXT' NOT NULL, hnum INTEGER NOT NULL, idx INTEGER NOT NULL, FOREIGN KEY (hnum) REFERENCES 'Packages'(hnum));
CREATE INDEX 'Name_key_idx' ON 'Name'(key ASC);
```

Is there any documentation for what is stored in each table?

For example, it seems the `Name` table stores the names of all of the installed RPM packages, and from the schema for this table I can see that it has a foreign `hnum` key for the `Packages` table. But when I look at the `Packages` table, I can't make sense of the data, since it stores blobs:
```
sqlite> .schema Packages
CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL);
sqlite> select * from Packages limit 10;
1|
2|
3|
4|
5|
6|
7|
8|
9|
10|
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2211#discussioncomment-3775485
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/repo-discussions/2211/comments/3775485 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220930/313e1684/attachment.html>


More information about the Rpm-maint mailing list