def load_from_config(config): settings = config.get_settings() max_fetch_size = int(settings['storage_max_fetch_size']) strict = settings.get('storage_strict_json', False) client = create_from_config(config, prefix='storage_') return Storage(client=client, max_fetch_size=max_fetch_size, strict_json=strict)
def load_from_config(config): settings = config.get_settings() max_fetch_size = int(settings["storage_max_fetch_size"]) readonly = settings.get("readonly", False) client = create_from_config(config, prefix="storage_") return Storage(client=client, max_fetch_size=max_fetch_size, readonly=readonly)
def load_from_config(config): settings = config.get_settings() max_fetch_size = int(settings['storage_max_fetch_size']) strict = settings.get('storage_strict_json', False) readonly = settings.get('readonly', False) client = create_from_config(config, prefix='storage_') return Storage(client=client, max_fetch_size=max_fetch_size, strict_json=strict, readonly=readonly)
def setUp(self): from kinto.core.storage.postgresql.client import create_from_config self.connections = [] self.errors = [] config = testing.setUp(settings={ 'pooltest_url': 'sqlite:///:memory:', 'pooltest_pool_size': 2, 'pooltest_pool_timeout': 1, 'pooltest_max_backlog': 2, 'pooltest_max_overflow': 1, }) # Create an engine with known pool parameters. # Use create_from_config() to make sure it is used by default # and handles parameters. client = create_from_config(config, prefix='pooltest_') session = client.session_factory() self.engine = session.get_bind()
def load_from_config(config): client = create_from_config(config, prefix='permission_') return Permission(client=client)
def load_from_config(config): settings = config.get_settings() client = create_from_config(config, prefix='cache_', with_transaction=False) return Cache(client=client, cache_prefix=settings['cache_prefix'])
def load_from_config(config): settings = config.get_settings() max_fetch_size = int(settings['storage_max_fetch_size']) client = create_from_config(config, prefix='storage_') return Storage(client=client, max_fetch_size=max_fetch_size)
def load_from_config(config): settings = config.get_settings() client = create_from_config(config, prefix='cache_') return Cache(client=client, cache_prefix=settings['cache_prefix'])