We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95b5bf6 commit 19b86b3Copy full SHA for 19b86b3
src/cs50/sql.py
@@ -89,6 +89,11 @@ def connect(dbapi_connection, connection_record):
89
finally:
90
self._logger.disabled = disabled
91
92
+ def __del__(self):
93
+ """Close database connection."""
94
+ if hasattr(self, "_connection"):
95
+ self._connection.close()
96
+
97
@_enable_logging
98
def execute(self, sql, *args, **kwargs):
99
"""Execute a SQL statement."""
0 commit comments