diff -r 5798c437f5ca -r d8f323bf5c7e src/source/alchemy/pyams_alchemy.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/source/alchemy/pyams_alchemy.rst Mon Mar 26 17:48:15 2018 +0200 @@ -0,0 +1,91 @@ +.. _pyams_alchemy: + +PyAMS SQLAlchemy integration +============================ + +*pyams_alchemy* package is a small package which can be used to make SQLAlchemy integration more simple. + +The main goal of *pyams_alchemy* package is to define the :class:`pyams_alchemy.engine.AlchemyEngineUtility` class: +this class can be stored persistently into PyAMS local site manager (see :ref:`site`) to store settings of an +SQLAlchemy engine; on user request, the :func:`pyams_alchemy.engine.get_user_session` function can be used to get +access to a new SQLAlchemy engine session matching these settings which will to be bound to current Pyramid's +transaction. + + +Dynamic schema names +++++++++++++++++++++ + +Some times you may have to be able to setup, for a given table, a schema name which is not static but can be dynamic +through a configuration option. + +This can be done easily with the help of the :class:`pyams_alchemy.mixin.DynamicSchemaMixin` which you can inherit from +in any SQLAlchemy table subclass. + +When this is done, the schema name can be defined into Pyramid's configuration file into a setting which is called +*pyams_alchemy:{module_name}.{class_name}.schema*; for example like in +*pyams_alchemy:pyams_content.package.TableName.schema*. If not specified, the table's schema name can be defined in a +classic *__schema__* table's attribute. + + + +Module contents ++++++++++++++++ + +.. automodule:: pyams_alchemy + :members: + :undoc-members: + :show-inheritance: + + +Submodules +++++++++++ + +pyams\_alchemy\.engine module +----------------------------- + +.. automodule:: pyams_alchemy.engine + :members: + :undoc-members: + :show-inheritance: + +pyams\_alchemy\.loader module +----------------------------- + +.. automodule:: pyams_alchemy.loader + :members: + :undoc-members: + :show-inheritance: + +pyams\_alchemy\.metaconfigure module +------------------------------------ + +.. automodule:: pyams_alchemy.metaconfigure + :members: + :undoc-members: + :show-inheritance: + +pyams\_alchemy\.metadirectives module +------------------------------------- + +.. automodule:: pyams_alchemy.metadirectives + :members: + :undoc-members: + :show-inheritance: + +pyams\_alchemy\.mixin module +---------------------------- + +.. automodule:: pyams_alchemy.mixin + :members: + :undoc-members: + :show-inheritance: + + +Subpackages ++++++++++++ + +.. toctree:: + + pyams_alchemy.interfaces + pyams_alchemy.tests + pyams_alchemy.zmi