diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-06-09 16:28:00 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-06-09 16:28:00 +0000 |
| commit | 2a2454a0ca42044301ca0c244b5074bd464359ca (patch) | |
| tree | dc53124567233c71fe3ffed05db44dc8e7dceed5 /doc | |
| parent | 6322cb20974b1d702b9fa0cfc07dbef2c549797c (diff) | |
| parent | 3512d51600c250f72911313e3f204552c250ece7 (diff) | |
| download | sqlalchemy-2a2454a0ca42044301ca0c244b5074bd464359ca.tar.gz | |
Merge "updated historical terms with modern equivalents"
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/orm/persistence_techniques.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/build/orm/persistence_techniques.rst b/doc/build/orm/persistence_techniques.rst index 18e4d1269..27c8c382f 100644 --- a/doc/build/orm/persistence_techniques.rst +++ b/doc/build/orm/persistence_techniques.rst @@ -591,21 +591,21 @@ More comprehensive rule-based class-level partitioning can be built by overriding the :meth:`.Session.get_bind` method. Below we illustrate a custom :class:`.Session` which delivers the following rules: -1. Flush operations are delivered to the engine named ``master``. +1. Flush operations are delivered to the engine named ``leader``. 2. Operations on objects that subclass ``MyOtherClass`` all occur on the ``other`` engine. 3. Read operations for all other classes occur on a random - choice of the ``slave1`` or ``slave2`` database. + choice of the ``follower1`` or ``follower2`` database. :: engines = { - 'master':create_engine("sqlite:///master.db"), + 'leader':create_engine("sqlite:///leader.db"), 'other':create_engine("sqlite:///other.db"), - 'slave1':create_engine("sqlite:///slave1.db"), - 'slave2':create_engine("sqlite:///slave2.db"), + 'follower1':create_engine("sqlite:///follower1.db"), + 'follower2':create_engine("sqlite:///follower2.db"), } from sqlalchemy.orm import Session, sessionmaker @@ -616,10 +616,10 @@ a custom :class:`.Session` which delivers the following rules: if mapper and issubclass(mapper.class_, MyOtherClass): return engines['other'] elif self._flushing: - return engines['master'] + return engines['leader'] else: return engines[ - random.choice(['slave1','slave2']) + random.choice(['follower1','follower2']) ] The above :class:`.Session` class is plugged in using the ``class_`` |
