mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
prepare_connection plugin hook
Closes: - #574 Refs #567 --------- Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
091c63cfbf
commit
3f80a02698
5 changed files with 79 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue