mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
make sqlite import consistent
This commit is contained in:
parent
e441d93a56
commit
61969dd682
@ -20,7 +20,6 @@
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from sqlite3 import Connection, Cursor
|
|
||||||
from typing import Any, Dict, Tuple, TypeVar, Callable
|
from typing import Any, Dict, Tuple, TypeVar, Callable
|
||||||
|
|
||||||
from ahriman.core.lazy_logging import LazyLogging
|
from ahriman.core.lazy_logging import LazyLogging
|
||||||
@ -46,7 +45,7 @@ class Operations(LazyLogging):
|
|||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def factory(cursor: Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:
|
def factory(cursor: sqlite3.Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
dictionary factory based on official documentation
|
dictionary factory based on official documentation
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ class Operations(LazyLogging):
|
|||||||
result[column[0]] = row[index]
|
result[column[0]] = row[index]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def with_connection(self, query: Callable[[Connection], T], commit: bool = False) -> T:
|
def with_connection(self, query: Callable[[sqlite3.Connection], T], commit: bool = False) -> T:
|
||||||
"""
|
"""
|
||||||
perform operation in connection
|
perform operation in connection
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user