Skip to content

Commit

Permalink
added pool_pre_ping=True to create_engine for database stability
Browse files Browse the repository at this point in the history
  • Loading branch information
barrydaniels-nl committed Nov 12, 2024
1 parent 283a0cb commit 29e8d84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2024-10-12 (6.1.2)

* Added pool_pre_ping=True to the database connection.

# 2024-10-01 (6.1.1)

* Fixed crash in `schema permissions apply` for tables that don't have a sequence in the database.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = amsterdam-schema-tools
version = 6.1.1
version = 6.1.2
url = https://github.com/amsterdam/schema-tools
license = Mozilla Public 2.0
author = Team Data Diensten, van het Dataplatform onder de Directie Digitale Voorzieningen (Gemeente Amsterdam)
Expand Down
2 changes: 1 addition & 1 deletion src/schematools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

def _get_engine(db_url: str, pg_schemas: list[str] | None = None) -> sqlalchemy.engine.Engine:
"""Initialize the SQLAlchemy engine, and report click errors."""
kwargs = {}
kwargs = {"pool_pre_ping": True}
if pg_schemas is not None:
csearch_path = ",".join(pg_schemas + ["public"])
kwargs["connect_args"] = {"options": f"-csearch_path={csearch_path}"}
Expand Down

0 comments on commit 29e8d84

Please sign in to comment.