From ae40dd6d81863a7fb2be104d9a65fd784b262ea7 Mon Sep 17 00:00:00 2001 From: Jeremiah Ogbomo Date: Fri, 22 Mar 2024 19:43:09 +0100 Subject: [PATCH] Improve check for if postgres session is still open (#2928) --- extras/drift_postgres/lib/src/pg_database.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extras/drift_postgres/lib/src/pg_database.dart b/extras/drift_postgres/lib/src/pg_database.dart index 7190742b7..af2c6689f 100644 --- a/extras/drift_postgres/lib/src/pg_database.dart +++ b/extras/drift_postgres/lib/src/pg_database.dart @@ -54,7 +54,8 @@ class _PgDelegate extends DatabaseDelegate { late DbVersionDelegate versionDelegate; @override - Future get isOpen => Future.value(_openedSession != null); + Future get isOpen => + Future.value(_openedSession != null && _openedSession!.isOpen); @override Future open(QueryExecutorUser user) async {