Skip to content

Commit

Permalink
Merge pull request #152 from mobiusml/postgres-deps
Browse files Browse the repository at this point in the history
postgres dependencies
  • Loading branch information
HRashidi authored Aug 8, 2024
2 parents 8af6495 + ebb083e commit 6c0474c
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 384 deletions.
2 changes: 1 addition & 1 deletion aana/storage/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create_postgresql_engine(config):
Returns:
sqlalchemy.engine.Engine: SQLAlchemy engine instance.
"""
connection_string = f"postgresql://{config['user']}:{config['password']}@{config['host']}:{config['port']}/{config['database']}"
connection_string = f"postgresql+psycopg://{config['user']}:{config['password']}@{config['host']}:{config['port']}/{config['database']}"
return create_engine(
connection_string,
json_serializer=lambda obj: orjson_serializer(obj).decode(),
Expand Down
2 changes: 1 addition & 1 deletion aana/tests/db/datastore/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_pg_datastore_config(pg_settings):
engine = pg_settings.get_engine()

assert engine.name == "postgresql"
assert str(engine.url) == "postgresql://postgres:***@0.0.0.0:5432/postgres"
assert str(engine.url) == "postgresql+psycopg://postgres:***@0.0.0.0:5432/postgres"


def test_sqlite_datastore_config(sqlite_settings):
Expand Down
Loading

0 comments on commit 6c0474c

Please sign in to comment.