> For the complete documentation index, see [llms.txt](https://docs.snowkill.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snowkill.net/storage/custom-storage.md).

# Custom storage

In order to create a custom stroage, please implement abstract class `AbstractStorage`.

Please also implement abstract method `store_and_remove_duplicate`. It accepts list of [CheckResults](/reference/check-result.md). It returns list of deduplicated and stored [CheckResults](/reference/check-result.md). If all results are "duplicates", it returns empty list.

### Examples

You may use existing storages as an example and a good starting point to create your own implementation:

{% embed url="<https://github.com/littleK0i/SnowKill/blob/master/snowkill/storage/snowflake_table.py>" %}
Snowflake table
{% endembed %}

{% embed url="<https://github.com/littleK0i/SnowKill/blob/master/snowkill/storage/postgres_table.py>" %}
Postgres table
{% endembed %}

### Notes

* Make sure to use "transactions" while implementing a storage or do everything in one big statement. It is important to correctly process either all "CheckResults" or none at all.

### Debugging

You may use special debug methods `dataclass_to_json_str(obj)` and `dataclass_to_dict_recursive(obj)`, which are exposed by `snowkill` package.

These methods are capable of converting SnowKill data structures to human-readable JSON string or to Python dictionary.
