Low level database

Note

Not recommended to be used in production.

Currently only the ‘user’ table exists, providing any other table name will result in a error.

Note

SqlWrapper & MongoWrapper are syntactically identical and are initialized into ‘AccountHandler._db_wrapper’

SQL

class aioaccount.SqlWrapper

Doesn’t cover SQL syntax entirely, but just includes needed functions.

await delete(table: str, and_: dict) None
await exists(table: str, or_: dict) bool
await get(table, and_: dict) Optional[Mapping]
await insert(table: str, values: dict) None
async for ... in iterate(table: str, and_: Optional[dict] = None) AsyncGenerator[Mapping, None]
await update(table: str, and_: dict, values: dict) None

Mongo

class aioaccount.MongoWrapper

Doesn’t cover mongo syntax entirely, but just includes needed functions.

await delete(table: str, and_: dict) None
await exists(table: str, or_: dict) bool
await get(table, and_: dict) Optional[Mapping]
await insert(table: str, values: dict) None
async for ... in iterate(table: str, and_: Optional[dict] = None) AsyncGenerator[Mapping, None]
await update(table: str, and_: dict, values: dict) None