add support for postgres ssl mode and root cert

This commit is contained in:
Maor Friedman 2025-08-18 11:46:46 +03:00
parent 5e7c2250be
commit 85637f3c89
2 changed files with 4 additions and 0 deletions

View file

@ -75,6 +75,8 @@ class PostgresKVStoreConfig(CommonConfig):
db: str = "llamastack" db: str = "llamastack"
user: str user: str
password: str | None = None password: str | None = None
ssl_mode: str | None = None
ssl_root_cert: str | None = None
table_name: str = "llamastack_kvstore" table_name: str = "llamastack_kvstore"
@classmethod @classmethod

View file

@ -30,6 +30,8 @@ class PostgresKVStoreImpl(KVStore):
database=self.config.db, database=self.config.db,
user=self.config.user, user=self.config.user,
password=self.config.password, password=self.config.password,
sslmode=self.config.ssl_mode,
sslrootcert=self.config.ssl_root_cert,
) )
self.conn.autocommit = True self.conn.autocommit = True
self.cursor = self.conn.cursor(cursor_factory=DictCursor) self.cursor = self.conn.cursor(cursor_factory=DictCursor)