my.telegram: initial module from telegram_backup
This commit is contained in:
parent
6594ad24dc
commit
6493859ba5
3 changed files with 86 additions and 0 deletions
|
@ -46,6 +46,8 @@ def sqlite_connection(db: PathIsh, *, immutable: bool=False, row_factory: Option
|
|||
dbp = f'file:{db}'
|
||||
# https://www.sqlite.org/draft/uri.html#uriimmutable
|
||||
if immutable:
|
||||
# assert results in nicer error than sqlite3.OperationalError
|
||||
assert Path(db).exists(), db
|
||||
dbp = f'{dbp}?immutable=1'
|
||||
row_factory_: Any = None
|
||||
if row_factory is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue