weaver.database =============== .. py:module:: weaver.database Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/weaver/database/base/index /autoapi/weaver/database/mongodb/index Package Contents ---------------- .. py:data:: LOGGER .. py:function:: get_db(container: Union[weaver.typedefs.AnyDatabaseContainer, weaver.typedefs.AnyRegistryContainer, weaver.typedefs.AnySettingsContainer, None] = None, reset_connection: bool = False) -> base.DatabaseInterface Obtains the database connection from configured application settings. If :paramref:`reset_connection` is ``True``, the :paramref:`container` must be the application :class:`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. .. py:function:: includeme(config: pyramid.config.Configurator) -> None