Database

Uses a Postgres database to store metadata. This includes a list of crates and crate versions that is synced to the list of crates on crates.io using the Registry Sync service, a list of registered Builders, a list of current or previous jobs and a list of artifacts for every crate version.

These are the tables that the database currently stores:

NameDescription
pubkeysPublic keys
pubkey_fingerprintsPublic key fingerprints
buildersBuilders that are registered with the backend.
targetsTargets that can be built.
builder_targetsTargets that are enabled per builder.
cratesCrates (synced from crates.io)
crate_versionsCrate versions (synced from crates.io)
job_stagesJob stages
jobsJobs
job_logsJob log entries
job_artifactsJob artifacts
job_artifact_downloadsDaily download counts for artifacts

Interactions

graph BT
    database[Database]
    backend[Backend]
    registry-sync[Registry Sync]

    backend --> database
    registry-sync --> database

    click backend "./backend.html"
    click registry-sync "./registry-sync.html"

There are two services that connect to the database: the backend and the registry sync service.

Dependencies

graph BT
    database[buildsrs_database]
    backend[buildsrs_backend]
    registry-sync[buildsrs_registry_sync]

    backend-->database
    registry-sync-->database

    click database "/rustdoc/buildsrs_database"
    click backend "/rustdoc/buildsrs_database"
    click registry-sync "/rustdoc/buildsrs_database"

All database interactions are implemented in the buildsrs_database crate.

Features

NameDescription
migrationsEnables migrations
cliEnables database CLI
tempCreation of temporary databases, used for testing
optionsCommand-line options parsing for database connection