Module spin_sdk.key_value
Module for accessing Spin key-value stores
Functions
async def open(name: str) ‑> Store-
Expand source code
async def open(name: str) -> Store: """ Open the store with the specified name. If `name` is "default", the default store is opened. Otherwise, `name` must refer to a store defined and configured in a runtime configuration file supplied with the application. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_NoSuchStore)` will be raised if the `name` is not recognized. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_AccessDenied)` will be raised if the requesting component does not have access to the specified store. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_StoreTableFull)` will be raised if too many stores have been opened simultaneously. Closing one or more previously opened stores might address this using the `__exit__` method. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_Other(str))` will be raised if some implementation specific error has occured (e.g I/O) """ return await Store.open(name)Open the store with the specified name.
If
nameis "default", the default store is opened. Otherwise,namemust refer to a store defined and configured in a runtime configuration file supplied with the application.A
componentize_py_types.Err(Error_NoSuchStore)will be raised if thenameis not recognized.A
componentize_py_types.Err(Error_AccessDenied)will be raised if the requesting component does not have access to the specified store.A
componentize_py_types.Err(Error_StoreTableFull)will be raised if too many stores have been opened simultaneously. Closing one or more previously opened stores might address this using the__exit__method.A
componentize_py_types.Err(Error_Other(str))will be raised if some implementation specific error has occured (e.g I/O) async def open_default() ‑> Store-
Expand source code
async def open_default() -> Store: """ Open the default store. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_AccessDenied)` will be raised if the requesting component does not have access to the default store. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_StoreTableFull)` will be raised if too many stores have been opened simultaneously. Closing one or more previously opened stores might address this using the `__exit__` method. A `componentize_py_types.Err(spin_sdk.wit.imports.spin_key_value_key_value_3_0_0.Error_Other(str))` will be raised if some implementation specific error has occured (e.g I/O) """ return await Store.open("default")Open the default store.
A
componentize_py_types.Err(Error_AccessDenied)will be raised if the requesting component does not have access to the default store.A
componentize_py_types.Err(Error_StoreTableFull)will be raised if too many stores have been opened simultaneously. Closing one or more previously opened stores might address this using the__exit__method.A
componentize_py_types.Err(Error_Other(str))will be raised if some implementation specific error has occured (e.g I/O)