Changes between Initial Version and Version 1 of DatabaseTier


Ignore:
Timestamp:
09/23/2008 01:25:29 AM (9 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseTier

    v1 v1  
     1{{{ 
     2#!rst 
     3Database tier 
     4============= 
     5 
     6You can use `SQLAlchemy <http://www.sqlalchemy.org/>`_ or its declarative 
     7layer `Elixir <http://elixir.ematia.de/>`_ with Nagare. For each request 
     8received, Nagare creates a database transaction which is commited at the end 
     9of the request handling or rollbacked if an exception is raised. 
     10 
     11The database connection is activated and configurated in the ``[database]`` section 
     12of the application configuration file as described in 
     13:wiki:`ApplicationConfiguration#database-section`. One of the parameters in 
     14this section is the location of the 
     15`__metadata__ <http://www.sqlalchemy.org/docs/04/metadata.html>`_ object of 
     16SQLAlchemy: 
     17 
     18  - which must be explicitly created:   
     19 
     20    .. code-block:: python 
     21     
     22       from elixir import * 
     23       from sqlalchemy import MetaData 
     24     
     25       __metadata__ = MetaData() 
     26        
     27       # Database definitions 
     28       ... 
     29 
     30  - which Nagare automatically binds to the database engine when the application 
     31    is launched 
     32 
     33  - where your code must explicitly register the 
     34    `table definitions <http://www.sqlalchemy.org/docs/04/ormtutorial.html#datamapping_tables>`_ 
     35    if you are using SQLAlchemy only 
     36 
     37  - where Elixir automatically register the entities defined (see for example 
     38    the Wiki entities definition at :browser:`examples/nagare/examples/wiki/wikidata.py`) 
     39 
     40.. wikiname: DatabaseTier 
     41}}}