Exemplo n.º 1
0
    def __init__(self, pool=None, testing=False):
        if pool is not None:
            self.pool = pool
            self.transactor = Transactor(pool)

        self.started = False
        self.__testing = testing

        if not self.zstorm_configured:
            provideUtility(global_zstorm, IZStorm)
            self._patch_sqlite_uris()
            self._set_zstorm_default_uris(getUtility(IZStorm))

        SQLite.register()
        MySQL.register()
        PostgreSQL.register()
Exemplo n.º 2
0
    def __init__(self, pool=None, testing=False):
        if pool is not None:
            self.pool = pool
            self.transactor = Transactor(pool)

        self.started = False
        self.__testing = testing

        if not self.zstorm_configured:
            provideUtility(global_zstorm, IZStorm)
            zstorm = getUtility(IZStorm)
            if self.backend == 'sqlite' and sqlite_version_info >= (3, 6, 19):
                uri = '{}?foreign_keys=1'.format(config.Database().uri)
            else:
                uri = config.Database().uri
            zstorm.set_default_uri('mamba', uri)

        SQLite.register()
        MySQL.register()
        PostgreSQL.register()
Exemplo n.º 3
0
    def __init__(self, pool=None, testing=False):
        if pool is not None:
            self.pool = pool
            self.transactor = Transactor(pool)

        self.started = False
        self.__testing = testing

        if not self.zstorm_configured:
            provideUtility(global_zstorm, IZStorm)
            zstorm = getUtility(IZStorm)
            if self.backend == 'sqlite' and sqlite_version_info >= (3, 6, 19):
                uri = '{}?foreign_keys=1'.format(config.Database().uri)
            else:
                uri = config.Database().uri
            zstorm.set_default_uri('mamba', uri)

        SQLite.register()
        MySQL.register()
        PostgreSQL.register()
Exemplo n.º 4
0
    def __init__(self, pool=None, testing=False):
        if pool is not None:
            self.pool = pool

        self.started = False
        self.__testing = testing

        if not self.zstorm_configured:
            provideUtility(global_zstorm, IZStorm)
            zstorm = getUtility(IZStorm)
            zstorm.set_default_uri('mamba', config.Database().uri)

        SQLite.register()
        MySQL.register()
        PostgreSQL.register()

        # MonkeyPatch Storm
        if not self.monkey_patched:
            monkey_patcher = MonkeyPatcher(
                (properties, 'PropertyColumn', PropertyColumnMambaPatch))
            monkey_patcher.patch()
            self.monkey_patched = True
Exemplo n.º 5
0
    def __init__(self, pool=None, testing=False):
        if pool is not None:
            self.pool = pool

        self.started = False
        self.__testing = testing

        if not self.zstorm_configured:
            provideUtility(global_zstorm, IZStorm)
            zstorm = getUtility(IZStorm)
            zstorm.set_default_uri('mamba', config.Database().uri)

        SQLite.register()
        MySQL.register()
        PostgreSQL.register()

        # MonkeyPatch Storm
        if not self.monkey_patched:
            monkey_patcher = MonkeyPatcher(
                (properties, 'PropertyColumn', PropertyColumnMambaPatch)
            )
            monkey_patcher.patch()
            self.monkey_patched = True