add postgres kvstoreimpl (#374)

* add postgres kvstoreimpl

* make table name configurable

* add validator for table name

* linter fix

---------

Co-authored-by: Dinesh Yeduguru <dineshyv@fb.com>
This commit is contained in:
Dinesh Yeduguru 2024-11-05 11:42:21 -08:00 committed by GitHub
parent 8de845a96d
commit dcd8cfe0f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 131 additions and 2 deletions

View file

@ -43,7 +43,9 @@ async def kvstore_impl(config: KVStoreConfig) -> KVStore:
impl = SqliteKVStoreImpl(config)
elif config.type == KVStoreType.postgres.value:
raise NotImplementedError()
from .postgres import PostgresKVStoreImpl
impl = PostgresKVStoreImpl(config)
else:
raise ValueError(f"Unknown kvstore type {config.type}")