Merge remote-tracking branch 'origin/master' into rustedbuilds
Conflicts: data/database.py endpoints/api.py endpoints/common.py test/data/test.db
This commit is contained in:
commit
d5304f7db0
128 changed files with 845 additions and 207343 deletions
26
config.py
26
config.py
|
@ -35,7 +35,15 @@ class MailConfig(object):
|
|||
TESTING = False
|
||||
|
||||
|
||||
class SQLiteDB(object):
|
||||
class RealTransactions(object):
|
||||
@staticmethod
|
||||
def create_transaction(db):
|
||||
return db.transaction()
|
||||
|
||||
DB_TRANSACTION_FACTORY = create_transaction
|
||||
|
||||
|
||||
class SQLiteDB(RealTransactions):
|
||||
DB_NAME = 'test/data/test.db'
|
||||
DB_CONNECTION_ARGS = {
|
||||
'threadlocals': True
|
||||
|
@ -43,13 +51,27 @@ class SQLiteDB(object):
|
|||
DB_DRIVER = SqliteDatabase
|
||||
|
||||
|
||||
class FakeTransaction(object):
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, value, traceback):
|
||||
pass
|
||||
|
||||
|
||||
class EphemeralDB(object):
|
||||
DB_NAME = ':memory:'
|
||||
DB_CONNECTION_ARGS = {}
|
||||
DB_DRIVER = SqliteDatabase
|
||||
|
||||
@staticmethod
|
||||
def create_transaction(db):
|
||||
return FakeTransaction()
|
||||
|
||||
class RDSMySQL(object):
|
||||
DB_TRANSACTION_FACTORY = create_transaction
|
||||
|
||||
|
||||
class RDSMySQL(RealTransactions):
|
||||
DB_NAME = 'quay'
|
||||
DB_CONNECTION_ARGS = {
|
||||
'host': 'fluxmonkeylogin.cb0vumcygprn.us-east-1.rds.amazonaws.com',
|
||||
|
|
Reference in a new issue