mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-22 19:21:08 +00:00
properly convert Date objects for sqlite databases
This commit is contained in:
parent
de190fcdd3
commit
1516f27b76
|
@ -1,3 +1,6 @@
|
|||
import sqlite3
|
||||
|
||||
from blib import Date
|
||||
from bsql import Database
|
||||
|
||||
from .config import THEMES, ConfigData
|
||||
|
@ -9,6 +12,9 @@ from ..config import Config
|
|||
from ..misc import get_resource
|
||||
|
||||
|
||||
sqlite3.register_adapter(Date, Date.timestamp)
|
||||
|
||||
|
||||
def get_database(config: Config, migrate: bool = True) -> Database[Connection]:
|
||||
options = {
|
||||
'connection_class': Connection,
|
||||
|
|
Loading…
Reference in a new issue