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

FieldSample dataDescription
id1Autoincrement id
info_hashc1277613db1d28709b034a017ab2cae4be07ae10BitTorrent infohash V1
completed20The 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

FieldSample dataDescription
id1Autoincrement id
info_hashc1277613db1d28709b034a017ab2cae4be07ae10BitTorrent infohash V1

Authentication keys

FieldSample dataDescription
id1Autoincrement id
keyIrweYtVuQPGbG9Jzx1DihcPmJGGpVy82Token
valid_until1672419840Timestamp for the expiring date

NOTICE: All keys must have an expiration date.

Modules

  • Database driver factory.
  • Database errors.
  • The MySQL database driver.
  • The SQLite3 database driver.

Traits

  • The persistence trait. It contains all the methods to interact with the database.