Now using BACKEND flags from Persistent.
This commit is contained in:
parent
410f6f8cbf
commit
1ecf88cd8f
|
@ -20,9 +20,6 @@ class Database( object ):
|
||||||
ID_BITS = 128 # number of bits within an id
|
ID_BITS = 128 # number of bits within an id
|
||||||
ID_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz"
|
ID_DIGITS = "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
||||||
POSTGRESQL_BACKEND = 0
|
|
||||||
SQLITE_BACKEND = 1
|
|
||||||
|
|
||||||
# caching Notebooks causes problems because different users have different read_write/owner values
|
# caching Notebooks causes problems because different users have different read_write/owner values
|
||||||
CLASSES_NOT_TO_CACHE = ( Notebook, )
|
CLASSES_NOT_TO_CACHE = ( Notebook, )
|
||||||
|
|
||||||
|
@ -71,7 +68,7 @@ class Database( object ):
|
||||||
self.__connection = connection or \
|
self.__connection = connection or \
|
||||||
Connection_wrapper( sqlite.connect( "luminotes.db", detect_types = sqlite.PARSE_DECLTYPES, check_same_thread = False ) )
|
Connection_wrapper( sqlite.connect( "luminotes.db", detect_types = sqlite.PARSE_DECLTYPES, check_same_thread = False ) )
|
||||||
self.__pool = None
|
self.__pool = None
|
||||||
self.__backend = Database.SQLITE_BACKEND
|
self.__backend = Persistent.SQLITE_BACKEND
|
||||||
else:
|
else:
|
||||||
import psycopg2 as psycopg
|
import psycopg2 as psycopg
|
||||||
from psycopg2.pool import PersistentConnectionPool
|
from psycopg2.pool import PersistentConnectionPool
|
||||||
|
@ -100,7 +97,7 @@ class Database( object ):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.__backend = Database.POSTGRESQL_BACKEND
|
self.__backend = Persistent.POSTGRESQL_BACKEND
|
||||||
|
|
||||||
self.__cache = cache
|
self.__cache = cache
|
||||||
|
|
||||||
|
|
Reference in New Issue