32
32
<link rel="index" title="Index" href="../../genindex.html" />
33
33
<link rel="search" title="Search" href="../../search.html" />
34
34
<link rel="copyright" title="Copyright" href="../../copyright.html" />
35
<link rel="top" title="SQLAlchemy 0.7 Documentation" href="../../index.html" />
35
<link rel="top" title="SQLAlchemy 0.8 Documentation" href="../../index.html" />
36
36
<link rel="up" title="ORM Extensions" href="index.html" />
37
37
<link rel="next" title="Hybrid Attributes" href="hybrid.html" />
38
38
<link rel="prev" title="Ordering List" href="orderinglist.html" />
95
95
<div id="docs-navigation-banner">
96
<a href="../../index.html">SQLAlchemy 0.7 Documentation</a>
96
<a href="../../index.html">SQLAlchemy 0.8 Documentation</a>
97
97
» <a href="../index.html" title="SQLAlchemy ORM">SQLAlchemy ORM</a>
98
98
» <a href="index.html" title="ORM Extensions">ORM Extensions</a>
165
165
<col class="field-body" />
166
166
<tbody valign="top">
167
167
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
168
<li><strong>shard_chooser</strong> – A callable which, passed a Mapper, a mapped instance, and possibly a
169
SQL clause, returns a shard ID. This id may be based off of the
170
attributes present within the object, or on some round-robin
171
scheme. If the scheme is based on a selection, it should set
172
whatever state on the instance to mark it in the future as
168
<li><strong>shard_chooser</strong> – A callable which, passed a Mapper, a mapped
169
instance, and possibly a SQL clause, returns a shard ID. This id
170
may be based off of the attributes present within the object, or on
171
some round-robin scheme. If the scheme is based on a selection, it
172
should set whatever state on the instance to mark it in the future as
173
173
participating in that shard.</li>
174
<li><strong>id_chooser</strong> – A callable, passed a query and a tuple of identity values, which
175
should return a list of shard ids where the ID might reside. The
176
databases will be queried in the order of this listing.</li>
177
<li><strong>query_chooser</strong> – For a given Query, returns the list of shard_ids where the query
178
should be issued. Results from all shards returned will be combined
179
together into a single listing.</li>
180
<li><strong>shards</strong> – A dictionary of string shard names to <a class="reference internal" href="../../core/connections.html#sqlalchemy.engine.base.Engine" title="sqlalchemy.engine.base.Engine"><tt class="xref py py-class docutils literal"><span class="pre">Engine</span></tt></a>
174
<li><strong>id_chooser</strong> – A callable, passed a query and a tuple of identity
175
values, which should return a list of shard ids where the ID might
176
reside. The databases will be queried in the order of this listing.</li>
177
<li><strong>query_chooser</strong> – For a given Query, returns the list of shard_ids
178
where the query should be issued. Results from all shards returned
179
will be combined together into a single listing.</li>
180
<li><strong>shards</strong> – A dictionary of string shard names
181
to <a class="reference internal" href="../../core/connections.html#sqlalchemy.engine.Engine" title="sqlalchemy.engine.Engine"><tt class="xref py py-class docutils literal"><span class="pre">Engine</span></tt></a> objects.</li>
215
215
<a href="hybrid.html" title="next chapter">Hybrid Attributes</a>
217
217
<div id="docs-copyright">
218
© <a href="../../copyright.html">Copyright</a> 2007-2012, the SQLAlchemy authors and contributors.
218
© <a href="../../copyright.html">Copyright</a> 2007-2013, the SQLAlchemy authors and contributors.
219
219
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.