Attention
This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.
harp_apps.sqlalchemy_storage.storage¶
- class SqlAlchemyStorage[source]¶
Bases:
Storage
Storage implementation using SQL Alchemy Core, with async drivers.
Currently supported/tested database drivers:
aiosqlite (sqlite+aiosqlite://…)
- __init__(dispatcher, settings)[source]¶
- Parameters:
dispatcher (IAsyncEventDispatcher)
settings (SqlAlchemyStorageSettings)
- async create_users_once_ready(users)[source]¶
Sets the list of users to be created once the database is ready.
- async get_blob(blob_id)[source]¶
Retrieve a blob from the database, using its hash. Returns None if not found.
- Parameters:
blob_id – sha1 hash of the blob
- Returns:
Blob or None
- async get_transaction(id, /, *, username)[source]¶
Find a transaction, by id.
- Parameters:
- Return type:
Transaction | None
- async get_transaction_list(*, username, with_messages=False, filters=None, page=1, cursor='', text_search='')[source]¶
Implements
Storage.find_transactions
.
- async set_user_flag(*, transaction_id, username, flag, value=True)[source]¶
Sets or unsets a user flag on a transaction.
- async transactions_grouped_by_time_bucket(endpoint=None, time_bucket='day', start_datetime=None)[source]¶
- Parameters:
- Return type:
- engine: AsyncEngine¶
Reference to the sqlalchemy async engine, which is a gateway to the database connectivity, able to provide a connection used to execute queries.
- property worker¶