Expand description
The persistence module.
Persistence is currently implemented with one Database trait.
There are two implementations of the trait (two drivers):
NOTICE: There are no database migrations. If there are any changes, we will implemented them or provide a script to migrate to the new schema.
The persistent objects are:
§Torrent metrics
| Field | Sample data | Description |
|---|---|---|
id | 1 | Autoincrement id |
info_hash | c1277613db1d28709b034a017ab2cae4be07ae10 | BitTorrent infohash V1 |
completed | 20 | The number of peers that have ever completed downloading the torrent associated to this entry. See Entry for more information. |
NOTICE: The peer list for a torrent is not persisted. Since peer have to re-announce themselves on intervals, the data is be regenerated again after some minutes.
§Torrent whitelist
| Field | Sample data | Description |
|---|---|---|
id | 1 | Autoincrement id |
info_hash | c1277613db1d28709b034a017ab2cae4be07ae10 | BitTorrent infohash V1 |
§Authentication keys
| Field | Sample data | Description |
|---|---|---|
id | 1 | Autoincrement id |
key | IrweYtVuQPGbG9Jzx1DihcPmJGGpVy82 | Token |
valid_until | 1672419840 | Timestamp for the expiring date |
NOTICE: All keys must have an expiration date.
Modules§
- driver
- Database driver factory.
- error
- Database errors.
- mysql
- The
MySQLdatabase driver. - sqlite
- The
SQLite3database driver.
Traits§
- Database
- The persistence trait. It contains all the methods to interact with the database.