diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-02 05:42:49 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-02 05:42:49 +0000 |
commit | b8b51fe4379936fe142c875ea0f17da14a12c27d (patch) | |
tree | 987fc4033cad747f0decfa80e38708a13d812d4c /doc/build | |
parent | 9f23ec7423e98305f43a0b7a7ef894da74325329 (diff) | |
download | sqlalchemy-b8b51fe4379936fe142c875ea0f17da14a12c27d.tar.gz |
- sessionmaker module is out, replaced with simple function in session.py
- scoping/class instrumenting behavior of sessionmaker moved into new scoping module
which implements scoped_session() (subject to potential name change)
- SessionContext / assignmapper are deprecated, replaced with scoped_session()
Diffstat (limited to 'doc/build')
-rw-r--r-- | doc/build/content/datamapping.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/build/content/datamapping.txt b/doc/build/content/datamapping.txt index 6308c8d7b..37afa0fd5 100644 --- a/doc/build/content/datamapping.txt +++ b/doc/build/content/datamapping.txt @@ -108,6 +108,12 @@ We're now ready to start talking to the database. The ORM's "handle" to the dat >>> from sqlalchemy.orm import sessionmaker >>> Session = sessionmaker(bind=engine, autoflush=True, transactional=True) +If you don't have an `Engine` yet, but want to define `Session`, define it without `bind`, and set the `bind` parameter later: + + {python} + >>> Session = sessionmaker(autoflush=True, transactional=True) + >>> Session.configure(bind=engine) # once engine is available + This `Session` class will create new `Session` objects which are bound to our database and have some various transactional characteristics. Whenever you need to have a conversation with the database, you instantiate a `Session`: {python} |