openwpm.storage.sql_provider module

class openwpm.storage.sql_provider.SQLiteStorageProvider(db_path: Path)[source]

Bases: StructuredStorageProvider

cur: Cursor
db: Connection
execute_statement(statement: str) None[source]
async finalize_visit_id(visit_id: VisitId, interrupted: bool = False) None[source]

This method is invoked to inform the StructuredStorageProvider that no more records for this visit_id will be submitted

This method returns once the data is ready to be written out. If the data is immediately written out nothing will be returned. Otherwise an awaitable will returned that resolve onces the records have been saved out to persistent storage

async flush_cache() None[source]

Blockingly write out any cached data to the respective storage

async init() None[source]

Initializes the StorageProvider for use

Guaranteed to be called in the process the StorageController runs in.

async shutdown() None[source]

Close all open resources After this method has been called no further calls should be made to the object

async store_record(table: TableName, visit_id: VisitId, record: Dict[str, Any]) None[source]

Submit a record to be stored The storing might not happen immediately