Skip to main content

Module sqlite

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 πŸ”’
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 πŸ”’
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 πŸ”’
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 πŸ”’
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 πŸ”’
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 πŸ”’
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 πŸ”’
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.
now_utc πŸ”’
Return SystemTime::get() as an OffsetDateTime in UTC.