Revert "Database: Disable alchemy pools" as that breaks the HUD (on PS at least)
This reverts commit 797c126318
.
This commit is contained in:
parent
b62a811e23
commit
dc28c31e02
|
@ -60,14 +60,11 @@ import Configuration
|
|||
# Other library modules
|
||||
try:
|
||||
import sqlalchemy.pool as pool
|
||||
#use_pool = True
|
||||
# Forcing to False so we can use connection.row_factory
|
||||
use_pool = False
|
||||
use_pool = True
|
||||
except ImportError:
|
||||
log.info(_("Not using sqlalchemy connection pool."))
|
||||
use_pool = False
|
||||
|
||||
|
||||
try:
|
||||
from numpy import var
|
||||
use_numpy = True
|
||||
|
@ -450,8 +447,7 @@ class Database:
|
|||
self.db_path = database
|
||||
log.info(_("Connecting to SQLite: %(database)s") % {'database':self.db_path})
|
||||
if os.path.exists(database) or create:
|
||||
self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES)
|
||||
self.connection.row_factory = sqlite3.Row
|
||||
self.connection = sqlite3.connect(self.db_path, detect_types=sqlite3.PARSE_DECLTYPES )
|
||||
self.__connected = True
|
||||
sqlite3.register_converter("bool", lambda x: bool(int(x)))
|
||||
sqlite3.register_adapter(bool, lambda x: "1" if x else "0")
|
||||
|
|
Loading…
Reference in New Issue
Block a user