weaver.database

Submodules

Package Contents

weaver.database.LOGGER[source]
weaver.database.get_db(container: Optional[Union[weaver.typedefs.AnyRegistryContainer, weaver.typedefs.AnySettingsContainer]] = None, reset_connection: bool = False) mongodb.MongoDatabase[source]

Obtains the database connection from configured application settings.

If reset_connection is True, the container must be the application Registry or any container that can retrieve it to accomplish reference reset. Otherwise, any settings container can be provided.

Note

It is preferable to provide a registry reference to reuse any available connection whenever possible. Giving application settings will require establishing a new connection.

weaver.database.includeme(config: pyramid.config.Configurator) None[source]