Module sqlite

Source
Expand description

Net document storage backed by sqlite3.

We store most objects in sqlite tables, except for very large ones, which we store as “blob” files in a separate directory.

Modules§

blob_consistency 🔒
Some notes on blob consistency, and the lack thereof.
blob_handle 🔒
Functionality related to uncommitted blobs.

Structs§

BridgeConfig 🔒 bridge-client
A relay not listed on the main tor network, used for anticensorship.
SqliteStore 🔒
Local directory cache using a Sqlite3 connection.

Enums§

AbsentBlob 🔒
Specific error returned when a blob will not be read.

Constants§

COUNT_EXTDOC_BY_PATH 🔒
Query: find whether an ExtDoc is listed.
DELETE_BRIDGEDESC 🔒 bridge-client
Query: Remove a cached bridge descriptor
DELETE_EXTDOC_BY_FILENAME 🔒
Query: Discard an extdoc with a given path.
DROP_OLD_AUTHCERTS 🔒
Query: Discard every expired authority certificate.
DROP_OLD_BRIDGEDESCS 🔒 bridge-client
Query: Discard every bridge descriptor that is too old, or from the future. (Both ?=now.)
DROP_OLD_CONSENSUSES 🔒
Query: Discard every consensus that’s been expired for at least two days.
DROP_OLD_EXTDOCS 🔒
Query: Discard every expired extdoc.
DROP_OLD_MICRODESCS 🔒
Query: Discard every microdescriptor that hasn’t been listed for 3 months.
DROP_OLD_ROUTERDESCS 🔒
Query: Discard every router descriptor that hasn’t been listed for 3 months.
FIND_ALL_EXTDOC_FILENAMES 🔒
Query: List all extdoc filenames.
FIND_AUTHCERT 🔒
Query: Find the authority certificate with given key digests.
FIND_BRIDGEDESC 🔒 bridge-client
Query: Find a cached bridge descriptor
FIND_CONSENSUS 🔒
Query: find the latest-expiring microdesc consensus, regardless of pending status.
FIND_CONSENSUS_AND_META_BY_DIGEST_OF_SIGNED 🔒
Look up a consensus by its digest-of-signed-part string.
FIND_CONSENSUS_P 🔒
Query: find the latest-expiring microdesc consensus with a given pending status.
FIND_EXPIRED_EXTDOCS 🔒
Query: find every ExtDocs member that has expired.
FIND_LATEST_CONSENSUS_META 🔒
Query: Find the valid-after time for the latest-expiring non-pending consensus of a given flavor.
FIND_LATEST_PROTOCOL_STATUS 🔒
Query: Get the latest protocol status.
FIND_MD 🔒
Query: find the microdescriptor with a given hex-encoded sha256 digest
FIND_RD 🔒 routerdesc
Query: find the router descriptors with a given hex-encoded sha1 digest
FIND_UNREFERENCED_CONSENSUS_EXTDOCS 🔒
Query: Find all consensus extdocs that are not referenced in the consensus table.
INSERT_AUTHCERT 🔒
Query: Add a new AuthCert
INSERT_BRIDGEDESC 🔒 bridge-client
Query: Record a cached bridge descriptor
INSERT_CONSENSUS 🔒
Query: Add a new consensus.
INSERT_EXTDOC 🔒
Query: Add a new entry to ExtDocs.
INSERT_MD 🔒
Query: Add a new microdescriptor
INSERT_RD 🔒 routerdesc
Query: Add a new router descriptor
INSTALL_V0_SCHEMA 🔒
Set up the tables for the arti cache schema in a sqlite database.
MARK_CONSENSUS_NON_PENDING 🔒
Query: Update the consensus whose digest field is ‘digest’ to call it no longer pending.
REMOVE_CONSENSUS 🔒
Query: Remove the consensus with a given digest field.
SCHEMA_VERSION 🔒
Version number used for this version of the arti cache schema.
UPDATE_MD_LISTED 🔒
Query: Change the time when a given microdescriptor was last listed.
UPDATE_PROTOCOL_STATUS 🔒
Query: Update the latest protocol status.
UPDATE_SCHEMA 🔒
Update the database schema, from each version to the next
UPDATE_SCHEMA_VERSION 🔒
Update the database schema version tracking, from each version to the next

Functions§

cmeta_from_row 🔒
Create a ConsensusMeta from a Row returned by one of FIND_LATEST_CONSENSUS_META or FIND_CONSENSUS_AND_META_BY_DIGEST.
digest_from_dstr 🔒
Convert a hexadecimal sha3-256 “digest string” as used in the digest column from the database into an array.
digest_from_hex 🔒
Convert a hexadecimal sha3-256 digest from the database into an array.