mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38:00 +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 bsql import Database
|
||||||
|
|
||||||
from .config import THEMES, ConfigData
|
from .config import THEMES, ConfigData
|
||||||
|
@ -9,6 +12,9 @@ from ..config import Config
|
||||||
from ..misc import get_resource
|
from ..misc import get_resource
|
||||||
|
|
||||||
|
|
||||||
|
sqlite3.register_adapter(Date, Date.timestamp)
|
||||||
|
|
||||||
|
|
||||||
def get_database(config: Config, migrate: bool = True) -> Database[Connection]:
|
def get_database(config: Config, migrate: bool = True) -> Database[Connection]:
|
||||||
options = {
|
options = {
|
||||||
'connection_class': Connection,
|
'connection_class': Connection,
|
||||||
|
|
Loading…
Reference in a new issue