Class Reference¶
-
class
rapid_dev_storage._base_api.
Storage
(backend: rapid_dev_storage._types.StorageBackend)[source]¶ This is the basic storage wrapper class.
It can be extended with additional functionality and adapters for specific data types, as well as adding facotry methods for instantiation including the required backend
-
class
rapid_dev_storage._base_api.
StorageGroup
(backend: rapid_dev_storage._types.StorageBackend, group_name: str)[source]¶
-
class
rapid_dev_storage._base_api.
StoredValue
(backend: rapid_dev_storage._types.StorageBackend, group_name: str, *keys: str)[source]¶ Representation of everything needed to interact with a stored value, methods included
-
clear_value
() → Awaitable[None][source]¶ Clears a value. This does not require that the value already existed
-
-
class
rapid_dev_storage._sqlite_backend.
SQLiteBackend
(connection, table_name: str, serializer, deserializer)[source]¶ This holds all the SQLite Logic.
All lookups operate on a composite primary key, ensuring that the abstration has minimal runtime performance overhead. This does incur a small cost to the DB size, though this is acceptible.
Interface is async despite the underlying code not being so. This is intentional, as if used as-is, without competeting on the same table with other applications, it should not block the event loop.
Meanwhile, the interface being async consistently leaves room for drop in replacements which may actually utilize the async nature, or further features which might have the potential to be blocking
There are a handful of computed SQL queries. These are limited against user input, and userinput is not allowed to be formatted in, with 1 exception of the table name. This name is restricted in nature as to be safe, and properly bracketed so that it is never seen as an SQL expression
Changes to the computed queries should be done with caution to ensure this remains true. For additional peace of mind, you can choose to disallow user input from being used as part of the table_name at the application layer, which leaves all remaining potential user input inserted as parameters.
-
class
rapid_dev_storage._types.
StorageBackend
[source]¶ This abstract base class shows the interfaces required to use a class as a replacement backend for the included ones
Interfaces here are async to allow dropping in other interfaces which would strictly need to be async