feat: Implement a prepare_connection plugin hook

This commit is contained in:
Alex Garcia 2023-07-22 15:31:53 -07:00
commit ae973e794b
4 changed files with 78 additions and 2 deletions

View file

@ -37,6 +37,7 @@ from typing import (
Tuple,
)
import uuid
from sqlite_utils.plugins import pm
try:
from sqlite_dump import iterdump
@ -342,6 +343,8 @@ class Database:
self._registered_functions: set = set()
self.use_counts_table = use_counts_table
pm.hook.prepare_connection(conn=self.conn)
def close(self):
"Close the SQLite connection, and the underlying database file"
self.conn.close()