.. _examples_toplevel:

Examples
========

The SQLAlchemy distribution includes a variety of code examples illustrating
a select set of patterns, some typical and some not so typical.   All are
runnable and can be found in the ``/examples`` directory of the
distribution.   Each example contains a README in its ``__init__.py`` file,
each of which are listed below.

Additional SQLAlchemy examples, some user contributed, are available on the
wiki at `<http://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.

.. _examples_adjacencylist:

Adjacency List
--------------

Location: /examples/adjacency_list/

.. automodule:: adjacency_list

.. _examples_associations:

Associations
------------

Location: /examples/association/

.. automodule:: association


.. _examples_instrumentation:

Attribute Instrumentation
-------------------------

Location: /examples/custom_attributes/

.. automodule:: custom_attributes

.. _examples_caching:

Dogpile Caching
---------------

Location: /examples/dogpile_caching/

.. automodule:: dogpile_caching

Directed Graphs
---------------

Location: /examples/graphs/

.. automodule:: graphs

Dynamic Relations as Dictionaries
----------------------------------

Location: /examples/dynamic_dict/

.. automodule:: dynamic_dict

.. _examples_generic_associations:

Generic Associations
--------------------

Location: /examples/generic_associations

.. automodule:: generic_associations

.. _examples_sharding:

Horizontal Sharding
-------------------

Location: /examples/sharding

.. automodule:: sharding

Inheritance Mappings
--------------------

Location: /examples/inheritance/

.. automodule:: inheritance

Large Collections
-----------------

Location: /examples/large_collection/

.. automodule:: large_collection

Nested Sets
-----------

Location: /examples/nested_sets/

.. automodule:: nested_sets

Polymorphic Associations
------------------------

See :ref:`examples_generic_associations` for a modern version of polymorphic associations.

.. _examples_postgis:

PostGIS Integration
-------------------

Location: /examples/postgis

.. automodule:: postgis

Versioned Objects
-----------------

Location: /examples/versioning

.. automodule:: versioning

Vertical Attribute Mapping
--------------------------

Location: /examples/vertical

.. automodule:: vertical

.. _examples_xmlpersistence:

XML Persistence
---------------

Location: /examples/elementtree/

.. automodule:: elementtree
