Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore
def load_datastore():
if not hasattr(settings, '_datastore'):
if not settings.DATASTORE_URI:
raise RuntimeError("No $MEMORIOUS_DATASTORE_URI.")
# do not pool connections for the datastore
engine_kwargs = {'poolclass': NullPool}
settings._datastore = dataset.connect(settings.DATASTORE_URI,
engine_kwargs=engine_kwargs)
# Use bigint to store integers by default
settings._datastore.types.integer = settings._datastore.types.bigint
return settings._datastore