Offset 1, 5 lines modified | Offset 1, 5 lines modified | ||
1 | · | 1 | ·c4e36c5dd9ea1dfe90c6eadd554d74e9·2567540·doc·optional·python-sqlalchemy-doc_1.3.22+ds1-1_all.deb |
2 | ·17b0aedbfba8e073045390c1250bc39b·36332·debug·optional·python3-sqlalchemy-ext-dbgsym_1.3.22+ds1-1_armhf.deb | 2 | ·17b0aedbfba8e073045390c1250bc39b·36332·debug·optional·python3-sqlalchemy-ext-dbgsym_1.3.22+ds1-1_armhf.deb |
3 | ·db4152acc6cd2193bc979f85bc914d65·18568·python·optional·python3-sqlalchemy-ext_1.3.22+ds1-1_armhf.deb | 3 | ·db4152acc6cd2193bc979f85bc914d65·18568·python·optional·python3-sqlalchemy-ext_1.3.22+ds1-1_armhf.deb |
4 | ·2c510f25be018fca64077b84bbd86a8e·794976·python·optional·python3-sqlalchemy_1.3.22+ds1-1_all.deb | 4 | ·2c510f25be018fca64077b84bbd86a8e·794976·python·optional·python3-sqlalchemy_1.3.22+ds1-1_all.deb |
Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | -rw-r--r--···0········0········0········4·2020-12-30·16:25:19.000000·debian-binary | 1 | -rw-r--r--···0········0········0········4·2020-12-30·16:25:19.000000·debian-binary |
2 | -rw-r--r--···0········0········0····11324·2020-12-30·16:25:19.000000·control.tar.xz | 2 | -rw-r--r--···0········0········0····11324·2020-12-30·16:25:19.000000·control.tar.xz |
3 | -rw-r--r--···0········0········0··255 | 3 | -rw-r--r--···0········0········0··2556024·2020-12-30·16:25:19.000000·data.tar.xz |
Offset 215, 26 lines modified | Offset 215, 26 lines modified | ||
215 | </div> | 215 | </div> |
216 | <div·class="section"·id="module-examples.association"> | 216 | <div·class="section"·id="module-examples.association"> |
217 | <span·id="associations"></span><span·id="examples-associations"></span><h3>Associations<a·class="headerlink"·href="#module-examples.association"·title="Permalink·to·this·headline">¶</a></h3> | 217 | <span·id="associations"></span><span·id="examples-associations"></span><h3>Associations<a·class="headerlink"·href="#module-examples.association"·title="Permalink·to·this·headline">¶</a></h3> |
218 | <p>Examples·illustrating·the·usage·of·the·“association·object”·pattern, | 218 | <p>Examples·illustrating·the·usage·of·the·“association·object”·pattern, |
219 | where·an·intermediary·class·mediates·the·relationship·between·two | 219 | where·an·intermediary·class·mediates·the·relationship·between·two |
220 | classes·that·are·associated·in·a·many-to-many·pattern.</p> | 220 | classes·that·are·associated·in·a·many-to-many·pattern.</p> |
221 | <p>Listing·of·files:<ul·class="simple"> | 221 | <p>Listing·of·files:<ul·class="simple"> |
222 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/proxied_association.html">proxied_association.py</a>·-·Same·example·as·basic_association,·adding·in | ||
223 | usage·of·<a·class="reference·internal"·href="extensions/associationproxy.html#module-sqlalchemy.ext.associationproxy"·title="sqlalchemy.ext.associationproxy"><code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">sqlalchemy.ext.associationproxy</span></code></a>·to·make·explicit·references | ||
224 | 222 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/dict_of_sets_with_default.html">dict_of_sets_with_default.py</a>·-·An·advanced·association·proxy·example·which | |
223 | illustrates·nesting·of·association·proxies·to·produce·multi-level·Python | ||
224 | collections,·in·this·case·a·dictionary·with·string·keys·and·sets·of·integers | ||
225 | as·values,·which·conceal·the·underlying·mapped·classes.</p> | ||
225 | </p></li> | 226 | </p></li> |
226 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/basic_association.html">basic_association.py</a>·-·Illustrate·a·many-to-many·relationship·between·an | 227 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/basic_association.html">basic_association.py</a>·-·Illustrate·a·many-to-many·relationship·between·an |
227 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price | 228 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price |
228 | with·each·via·an·association·object·called·“OrderItem”</p> | 229 | with·each·via·an·association·object·called·“OrderItem”</p> |
229 | </p></li> | 230 | </p></li> |
231 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/proxied_association.html">proxied_association.py</a>·-·Same·example·as·basic_association,·adding·in | ||
232 | usage·of·<a·class="reference·internal"·href="extensions/associationproxy.html#module-sqlalchemy.ext.associationproxy"·title="sqlalchemy.ext.associationproxy"><code·class="xref·py·py-mod·docutils·literal·notranslate"><span·class="pre">sqlalchemy.ext.associationproxy</span></code></a>·to·make·explicit·references | ||
233 | to·<code·class="docutils·literal·notranslate"><span·class="pre">OrderItem</span></code>·optional.</p> | ||
230 | <li><p><p><a·class="reference·external"·href="../_modules/examples/association/dict_of_sets_with_default.html">dict_of_sets_with_default.py</a>·-·An·advanced·association·proxy·example·which | ||
231 | illustrates·nesting·of·association·proxies·to·produce·multi-level·Python | ||
232 | collections,·in·this·case·a·dictionary·with·string·keys·and·sets·of·integers | ||
233 | as·values,·which·conceal·the·underlying·mapped·classes.</p> | ||
234 | </p></li> | 234 | </p></li> |
235 | </ul> | 235 | </ul> |
236 | </p> | 236 | </p> |
237 | </div> | 237 | </div> |
238 | <div·class="section"·id="module-examples.graphs"> | 238 | <div·class="section"·id="module-examples.graphs"> |
239 | <span·id="directed-graphs"></span><h3>Directed·Graphs<a·class="headerlink"·href="#module-examples.graphs"·title="Permalink·to·this·headline">¶</a></h3> | 239 | <span·id="directed-graphs"></span><h3>Directed·Graphs<a·class="headerlink"·href="#module-examples.graphs"·title="Permalink·to·this·headline">¶</a></h3> |
240 | <p>An·example·of·persistence·for·a·directed·graph·structure.···The | 240 | <p>An·example·of·persistence·for·a·directed·graph·structure.···The |
Offset 272, 37 lines modified | Offset 272, 37 lines modified | ||
272 | subclassing·the·<code·class="docutils·literal·notranslate"><span·class="pre">HasAddresses</span></code>·mixin,·which·ensures·that·the | 272 | subclassing·the·<code·class="docutils·literal·notranslate"><span·class="pre">HasAddresses</span></code>·mixin,·which·ensures·that·the |
273 | parent·class·is·provided·with·an·<code·class="docutils·literal·notranslate"><span·class="pre">addresses</span></code>·collection | 273 | parent·class·is·provided·with·an·<code·class="docutils·literal·notranslate"><span·class="pre">addresses</span></code>·collection |
274 | which·contains·<code·class="docutils·literal·notranslate"><span·class="pre">Address</span></code>·objects.</p> | 274 | which·contains·<code·class="docutils·literal·notranslate"><span·class="pre">Address</span></code>·objects.</p> |
275 | <p>The·<a·class="reference·external"·href="../_modules/examples/generic_associations/discriminator_on_association.html">discriminator_on_association.py</a>·and·<a·class="reference·external"·href="../_modules/examples/generic_associations/generic_fk.html">generic_fk.py</a>·scripts | 275 | <p>The·<a·class="reference·external"·href="../_modules/examples/generic_associations/discriminator_on_association.html">discriminator_on_association.py</a>·and·<a·class="reference·external"·href="../_modules/examples/generic_associations/generic_fk.html">generic_fk.py</a>·scripts |
276 | are·modernized·versions·of·recipes·presented·in·the·2007·blog·post | 276 | are·modernized·versions·of·recipes·presented·in·the·2007·blog·post |
277 | <a·class="reference·external"·href="http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/">Polymorphic·Associations·with·SQLAlchemy</a>.</p> | 277 | <a·class="reference·external"·href="http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/">Polymorphic·Associations·with·SQLAlchemy</a>.</p> |
278 | <p>Listing·of·files:<ul·class="simple"> | 278 | <p>Listing·of·files:<ul·class="simple"> |
279 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/table_per_association.html">table_per_association.py</a>·-·Illustrates·a·mixin·which·provides·a·generic·association | ||
280 | via·a·individually·generated·association·tables·for·each·parent·class. | ||
281 | The·associated·objects·themselves·are·persisted·in·a·single·table | ||
282 | shared·among·all·parents.</p> | ||
283 | </p></li> | ||
284 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/discriminator_on_association.html">discriminator_on_association.py</a>·-·Illustrates·a·mixin·which·provides·a·generic·association | 279 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/discriminator_on_association.html">discriminator_on_association.py</a>·-·Illustrates·a·mixin·which·provides·a·generic·association |
285 | using·a·single·target·table·and·a·single·association·table, | 280 | using·a·single·target·table·and·a·single·association·table, |
286 | referred·to·by·all·parent·tables.··The·association·table | 281 | referred·to·by·all·parent·tables.··The·association·table |
287 | contains·a·“discriminator”·column·which·determines·what·type·of | 282 | contains·a·“discriminator”·column·which·determines·what·type·of |
288 | parent·object·associates·to·each·particular·row·in·the·association | 283 | parent·object·associates·to·each·particular·row·in·the·association |
289 | table.</p> | 284 | table.</p> |
290 | </p></li> | 285 | </p></li> |
291 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/table_per_related.html">table_per_related.py</a>·-·Illustrates·a·generic·association·which·persists·association | ||
292 | objects·within·individual·tables,·each·one·generated·to·persist | ||
293 | those | 286 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/table_per_association.html">table_per_association.py</a>·-·Illustrates·a·mixin·which·provides·a·generic·association |
287 | via·a·individually·generated·association·tables·for·each·parent·class. | ||
288 | The·associated·objects·themselves·are·persisted·in·a·single·table | ||
289 | shared·among·all·parents.</p> | ||
294 | </p></li> | 290 | </p></li> |
295 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/generic_fk.html">generic_fk.py</a>·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar·fashion | 291 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/generic_fk.html">generic_fk.py</a>·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar·fashion |
296 | to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.··This | 292 | to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.··This |
297 | approach·bypasses·standard·referential·integrity | 293 | approach·bypasses·standard·referential·integrity |
298 | practices,·in·that·the·“foreign·key”·column·is·not·actually | 294 | practices,·in·that·the·“foreign·key”·column·is·not·actually |
299 | constrained·to·refer·to·any·particular·table;·instead, | 295 | constrained·to·refer·to·any·particular·table;·instead, |
300 | in-application·logic·is·used·to·determine·which·table·is·referenced.</p> | 296 | in-application·logic·is·used·to·determine·which·table·is·referenced.</p> |
301 | </p></li> | 297 | </p></li> |
298 | <li><p><p><a·class="reference·external"·href="../_modules/examples/generic_associations/table_per_related.html">table_per_related.py</a>·-·Illustrates·a·generic·association·which·persists·association | ||
299 | objects·within·individual·tables,·each·one·generated·to·persist | ||
300 | those·objects·on·behalf·of·a·particular·parent·class.</p> | ||
301 | </p></li> | ||
302 | </ul> | 302 | </ul> |
303 | </p> | 303 | </p> |
304 | </div> | 304 | </div> |
305 | <div·class="section"·id="module-examples.large_collection"> | 305 | <div·class="section"·id="module-examples.large_collection"> |
306 | <span·id="large-collections"></span><h3>Large·Collections<a·class="headerlink"·href="#module-examples.large_collection"·title="Permalink·to·this·headline">¶</a></h3> | 306 | <span·id="large-collections"></span><h3>Large·Collections<a·class="headerlink"·href="#module-examples.large_collection"·title="Permalink·to·this·headline">¶</a></h3> |
307 | <p>Large·collection·example.</p> | 307 | <p>Large·collection·example.</p> |
308 | <p>Illustrates·the·options·to·use·with | 308 | <p>Illustrates·the·options·to·use·with |
Offset 389, 33 lines modified | Offset 389, 33 lines modified | ||
389 | <div·class="admonition·seealso"> | 389 | <div·class="admonition·seealso"> |
390 | <p·class="admonition-title">See·also</p> | 390 | <p·class="admonition-title">See·also</p> |
391 | <p><a·class="reference·internal"·href="../faq/performance.html#faq-how-to-profile"><span·class="std·std-ref">How·can·I·profile·a·SQLAlchemy·powered·application?</span></a></p> | 391 | <p><a·class="reference·internal"·href="../faq/performance.html#faq-how-to-profile"><span·class="std·std-ref">How·can·I·profile·a·SQLAlchemy·powered·application?</span></a></p> |
392 | </div> | 392 | </div> |
393 | <div·class="section"·id="file-listing"> | 393 | <div·class="section"·id="file-listing"> |
394 | <h4>File·Listing<a·class="headerlink"·href="#file-listing"·title="Permalink·to·this·headline">¶</a></h4> | 394 | <h4>File·Listing<a·class="headerlink"·href="#file-listing"·title="Permalink·to·this·headline">¶</a></h4> |
395 | <p>Listing·of·files:<ul·class="simple"> | 395 | <p>Listing·of·files:<ul·class="simple"> |
396 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/large_resultsets.html">large_resultsets.py</a>·-·In·this·series·of·tests,·we·are·looking·at·time·to·load·a·large·number | ||
397 | of·very·small·and·simple·rows.</p> | ||
398 | </p></li> | ||
396 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_updates.html">bulk_updates.py</a>·-·This·series·of·tests·illustrates·different·ways·to·UPDATE·a·large·number | 399 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_updates.html">bulk_updates.py</a>·-·This·series·of·tests·illustrates·different·ways·to·UPDATE·a·large·number |
397 | of·rows·in·bulk.</p> | 400 | of·rows·in·bulk.</p> |
398 | </p></li> | 401 | </p></li> |
399 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/short_selects.html">short_selects.py</a>·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a·single | 402 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/short_selects.html">short_selects.py</a>·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a·single |
400 | record·by·primary·key</p> | 403 | record·by·primary·key</p> |
401 | </p></li> | 404 | </p></li> |
402 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/__main__.html">__main__.py</a>·-·Allows·the·examples/performance·package·to·be·run·as·a·script.</p> | ||
403 | </p></li> | ||
404 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_inserts.html">bulk_inserts.py</a>·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a·large·number | 405 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_inserts.html">bulk_inserts.py</a>·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a·large·number |
405 | of·rows·in·bulk.</p> | 406 | of·rows·in·bulk.</p> |
406 | </p></li> | 407 | </p></li> |
408 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/__main__.html">__main__.py</a>·-·Allows·the·examples/performance·package·to·be·run·as·a·script.</p> | ||
409 | </p></li> | ||
407 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/single_inserts.html">single_inserts.py</a>·-·In·this·series·of·tests,·we’re·looking·at·a·method·that·inserts·a·row | 410 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/single_inserts.html">single_inserts.py</a>·-·In·this·series·of·tests,·we’re·looking·at·a·method·that·inserts·a·row |
408 | within·a·distinct·transaction,·and·afterwards·returns·to·essentially·a | 411 | within·a·distinct·transaction,·and·afterwards·returns·to·essentially·a |
409 | “closed”·state.···This·would·be·analogous·to·an·API·call·that·starts·up | 412 | “closed”·state.···This·would·be·analogous·to·an·API·call·that·starts·up |
410 | a·database·connection,·inserts·the·row,·commits·and·closes.</p> | 413 | a·database·connection,·inserts·the·row,·commits·and·closes.</p> |
411 | </p></li> | 414 | </p></li> |
412 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/large_resultsets.html">large_resultsets.py</a>·-·In·this·series·of·tests,·we·are·looking·at·time·to·load·a·large·number | ||
413 | of·very·small·and·simple·rows.</p> | ||
414 | </p></li> | ||
415 | </ul> | 415 | </ul> |
416 | </p> | 416 | </p> |
417 | </div> | 417 | </div> |
418 | <div·class="section"·id="running-all-tests-with-time"> | 418 | <div·class="section"·id="running-all-tests-with-time"> |
419 | <h4>Running·all·tests·with·time<a·class="headerlink"·href="#running-all-tests-with-time"·title="Permalink·to·this·headline">¶</a></h4> | 419 | <h4>Running·all·tests·with·time<a·class="headerlink"·href="#running-all-tests-with-time"·title="Permalink·to·this·headline">¶</a></h4> |
420 | <p>This·is·the·default·form·of·run:</p> | 420 | <p>This·is·the·default·form·of·run:</p> |
421 | <div·class="highlight-default·notranslate"><div·class="highlight"><pre><span></span>$·python·-m·examples.performance·single_inserts | 421 | <div·class="highlight-default·notranslate"><div·class="highlight"><pre><span></span>$·python·-m·examples.performance·single_inserts |
Offset 557, 22 lines modified | Offset 557, 22 lines modified | ||
557 | </div> | 557 | </div> |
558 | <div·class="section"·id="module-examples.join_conditions"> | 558 | <div·class="section"·id="module-examples.join_conditions"> |
559 | <span·id="relationship-join-conditions"></span><span·id="examples-relationships"></span><h3>Relationship·Join·Conditions<a·class="headerlink"·href="#module-examples.join_conditions"·title="Permalink·to·this·headline">¶</a></h3> | 559 | <span·id="relationship-join-conditions"></span><span·id="examples-relationships"></span><h3>Relationship·Join·Conditions<a·class="headerlink"·href="#module-examples.join_conditions"·title="Permalink·to·this·headline">¶</a></h3> |
560 | <p>Examples·of·various·<a·class="reference·internal"·href="relationship_api.html#sqlalchemy.orm.relationship"·title="sqlalchemy.orm.relationship"><code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">relationship()</span></code></a>·configurations, | 560 | <p>Examples·of·various·<a·class="reference·internal"·href="relationship_api.html#sqlalchemy.orm.relationship"·title="sqlalchemy.orm.relationship"><code·class="xref·py·py-func·docutils·literal·notranslate"><span·class="pre">relationship()</span></code></a>·configurations, |
561 | which·make·use·of·the·<code·class="docutils·literal·notranslate"><span·class="pre">primaryjoin</span></code>·argument·to·compose·special·types | 561 | which·make·use·of·the·<code·class="docutils·literal·notranslate"><span·class="pre">primaryjoin</span></code>·argument·to·compose·special·types |
562 | of·join·conditions.</p> | 562 | of·join·conditions.</p> |
563 | <p>Listing·of·files:<ul·class="simple"> | 563 | <p>Listing·of·files:<ul·class="simple"> |
564 | <li><p><p><a·class="reference·external"·href="../_modules/examples/join_conditions/threeway.html">threeway.py</a>·-·Illustrate·a·“three·way·join”·-·where·a·primary·table·joins·to·a·remote | ||
565 | table·via·an·association·table,·but·then·the·primary·table·also·needs | ||
566 | to·refer·to·some·columns·in·the·remote·table·directly.</p> | ||
Max diff block lines reached; 11758/22990 bytes (51.14%) of diff not shown. |
Offset 75, 24 lines modified | Offset 75, 24 lines modified | ||
75 | Listing·of·files: | 75 | Listing·of·files: |
76 | ····*·adjacency_list.py | 76 | ····*·adjacency_list.py |
77 | ****·Associations¶·**** | 77 | ****·Associations¶·**** |
78 | Examples·illustrating·the·usage·of·the·“association·object”·pattern,·where·an | 78 | Examples·illustrating·the·usage·of·the·“association·object”·pattern,·where·an |
79 | intermediary·class·mediates·the·relationship·between·two·classes·that·are | 79 | intermediary·class·mediates·the·relationship·between·two·classes·that·are |
80 | associated·in·a·many-to-many·pattern. | 80 | associated·in·a·many-to-many·pattern. |
81 | Listing·of·files: | 81 | Listing·of·files: |
82 | ····*·proxied_association.py·-·Same·example·as·basic_association,·adding·in | ||
83 | ······usage·of·sqlalchemy.ext.associationproxy·to·make·explicit·references·to | ||
84 | ····· | 82 | ····*·dict_of_sets_with_default.py·-·An·advanced·association·proxy·example |
83 | ······which·illustrates·nesting·of·association·proxies·to·produce·multi-level | ||
84 | ······Python·collections,·in·this·case·a·dictionary·with·string·keys·and·sets | ||
85 | ······of·integers·as·values,·which·conceal·the·underlying·mapped·classes. | ||
85 | basic_association.py·-·Illustrate·a·many-to-many·relationship·between·an | 86 | basic_association.py·-·Illustrate·a·many-to-many·relationship·between·an |
86 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price·with | 87 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price·with |
87 | each·via·an·association·object·called·“OrderItem” | 88 | each·via·an·association·object·called·“OrderItem” |
89 | proxied_association.py·-·Same·example·as·basic_association,·adding·in·usage·of | ||
90 | sqlalchemy.ext.associationproxy·to·make·explicit·references·to·OrderItem | ||
91 | optional. | ||
88 | dict_of_sets_with_default.py·-·An·advanced·association·proxy·example·which | ||
89 | illustrates·nesting·of·association·proxies·to·produce·multi-level·Python | ||
90 | collections,·in·this·case·a·dictionary·with·string·keys·and·sets·of·integers·as | ||
91 | values,·which·conceal·the·underlying·mapped·classes. | ||
92 | ****·Directed·Graphs¶·**** | 92 | ****·Directed·Graphs¶·**** |
93 | An·example·of·persistence·for·a·directed·graph·structure.·The·graph·is·stored | 93 | An·example·of·persistence·for·a·directed·graph·structure.·The·graph·is·stored |
94 | as·a·collection·of·edges,·each·referencing·both·a·“lower”·and·an·“upper”·node | 94 | as·a·collection·of·edges,·each·referencing·both·a·“lower”·and·an·“upper”·node |
95 | in·a·table·of·nodes.·Basic·persistence·and·querying·for·lower-·and·upper- | 95 | in·a·table·of·nodes.·Basic·persistence·and·querying·for·lower-·and·upper- |
96 | neighbors·are·illustrated: | 96 | neighbors·are·illustrated: |
97 | n2·=·Node(2) | 97 | n2·=·Node(2) |
98 | n5·=·Node(5) | 98 | n5·=·Node(5) |
Offset 114, 31 lines modified | Offset 114, 31 lines modified | ||
114 | Supplier,·both·subclassing·the·HasAddresses·mixin,·which·ensures·that·the | 114 | Supplier,·both·subclassing·the·HasAddresses·mixin,·which·ensures·that·the |
115 | parent·class·is·provided·with·an·addresses·collection·which·contains·Address | 115 | parent·class·is·provided·with·an·addresses·collection·which·contains·Address |
116 | objects. | 116 | objects. |
117 | The·discriminator_on_association.py·and·generic_fk.py·scripts·are·modernized | 117 | The·discriminator_on_association.py·and·generic_fk.py·scripts·are·modernized |
118 | versions·of·recipes·presented·in·the·2007·blog·post·Polymorphic_Associations | 118 | versions·of·recipes·presented·in·the·2007·blog·post·Polymorphic_Associations |
119 | with_SQLAlchemy. | 119 | with_SQLAlchemy. |
120 | Listing·of·files: | 120 | Listing·of·files: |
121 | ····*·discriminator_on_association.py·-·Illustrates·a·mixin·which·provides·a | ||
122 | ······generic·association·using·a·single·target·table·and·a·single·association | ||
123 | ······table,·referred·to·by·all·parent·tables.·The·association·table·contains·a | ||
124 | ······“discriminator”·column·which·determines·what·type·of·parent·object | ||
125 | ······associates·to·each·particular·row·in·the·association·table. | ||
121 | 126 | table_per_association.py·-·Illustrates·a·mixin·which·provides·a·generic | |
122 | 127 | association·via·a·individually·generated·association·tables·for·each·parent | |
123 | 128 | class.·The·associated·objects·themselves·are·persisted·in·a·single·table·shared | |
129 | among·all·parents. | ||
124 | ······table·shared·among·all·parents. | ||
125 | discriminator_on_association.py·-·Illustrates·a·mixin·which·provides·a·generic | ||
126 | association·using·a·single·target·table·and·a·single·association·table, | ||
127 | referred·to·by·all·parent·tables.·The·association·table·contains·a | ||
128 | “discriminator”·column·which·determines·what·type·of·parent·object·associates | ||
129 | to·each·particular·row·in·the·association·table. | ||
130 | table_per_related.py·-·Illustrates·a·generic·association·which·persists | ||
131 | association·objects·within·individual·tables,·each·one·generated·to·persist | ||
132 | those·objects·on·behalf·of·a·particular·parent·class. | ||
133 | generic_fk.py·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar | 130 | generic_fk.py·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar |
134 | fashion·to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.·This·approach | 131 | fashion·to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.·This·approach |
135 | bypasses·standard·referential·integrity·practices,·in·that·the·“foreign·key” | 132 | bypasses·standard·referential·integrity·practices,·in·that·the·“foreign·key” |
136 | column·is·not·actually·constrained·to·refer·to·any·particular·table;·instead, | 133 | column·is·not·actually·constrained·to·refer·to·any·particular·table;·instead, |
137 | in-application·logic·is·used·to·determine·which·table·is·referenced. | 134 | in-application·logic·is·used·to·determine·which·table·is·referenced. |
135 | table_per_related.py·-·Illustrates·a·generic·association·which·persists | ||
136 | association·objects·within·individual·tables,·each·one·generated·to·persist | ||
137 | those·objects·on·behalf·of·a·particular·parent·class. | ||
138 | ****·Large·Collections¶·**** | 138 | ****·Large·Collections¶·**** |
139 | Large·collection·example. | 139 | Large·collection·example. |
140 | Illustrates·the·options·to·use·with·relationship()·when·the·list·of·related | 140 | Illustrates·the·options·to·use·with·relationship()·when·the·list·of·related |
141 | objects·is·very·large,·including: | 141 | objects·is·very·large,·including: |
142 | ····*·“dynamic”·relationships·which·query·slices·of·data·as·accessed | 142 | ····*·“dynamic”·relationships·which·query·slices·of·data·as·accessed |
143 | ····*·how·to·use·ON·DELETE·CASCADE·in·conjunction·with·passive_deletes=True·to | 143 | ····*·how·to·use·ON·DELETE·CASCADE·in·conjunction·with·passive_deletes=True·to |
144 | ······greatly·improve·the·performance·of·related·collection·deletion. | 144 | ······greatly·improve·the·performance·of·related·collection·deletion. |
Offset 196, 27 lines modified | Offset 196, 27 lines modified | ||
196 | $·python·-m·examples.performance·bulk_inserts·\ | 196 | $·python·-m·examples.performance·bulk_inserts·\ |
197 | ····--dburl·mysql+mysqldb://scott:tiger@localhost/test·\ | 197 | ····--dburl·mysql+mysqldb://scott:tiger@localhost/test·\ |
198 | ····--profile·--num·1000 | 198 | ····--profile·--num·1000 |
199 | See·also | 199 | See·also |
200 | How_can_I_profile_a_SQLAlchemy_powered_application? | 200 | How_can_I_profile_a_SQLAlchemy_powered_application? |
201 | ***·File·Listing¶·*** | 201 | ***·File·Listing¶·*** |
202 | Listing·of·files: | 202 | Listing·of·files: |
203 | ····*·large_resultsets.py·-·In·this·series·of·tests,·we·are·looking·at·time·to | ||
204 | ······load·a·large·number·of·very·small·and·simple·rows. | ||
203 | 205 | bulk_updates.py·-·This·series·of·tests·illustrates·different·ways·to·UPDATE·a | |
204 | 206 | large·number·of·rows·in·bulk. | |
205 | short_selects.py·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a | 207 | short_selects.py·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a |
206 | single·record·by·primary·key | 208 | single·record·by·primary·key |
207 | __main__.py·-·Allows·the·examples/performance·package·to·be·run·as·a·script. | ||
208 | bulk_inserts.py·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a | 209 | bulk_inserts.py·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a |
209 | large·number·of·rows·in·bulk. | 210 | large·number·of·rows·in·bulk. |
211 | __main__.py·-·Allows·the·examples/performance·package·to·be·run·as·a·script. | ||
210 | single_inserts.py·-·In·this·series·of·tests,·we’re·looking·at·a·method·that | 212 | single_inserts.py·-·In·this·series·of·tests,·we’re·looking·at·a·method·that |
211 | inserts·a·row·within·a·distinct·transaction,·and·afterwards·returns·to | 213 | inserts·a·row·within·a·distinct·transaction,·and·afterwards·returns·to |
212 | essentially·a·“closed”·state.·This·would·be·analogous·to·an·API·call·that | 214 | essentially·a·“closed”·state.·This·would·be·analogous·to·an·API·call·that |
213 | starts·up·a·database·connection,·inserts·the·row,·commits·and·closes. | 215 | starts·up·a·database·connection,·inserts·the·row,·commits·and·closes. |
214 | large_resultsets.py·-·In·this·series·of·tests,·we·are·looking·at·time·to·load·a | ||
215 | large·number·of·very·small·and·simple·rows. | ||
216 | ***·Running·all·tests·with·time¶·*** | 216 | ***·Running·all·tests·with·time¶·*** |
217 | This·is·the·default·form·of·run: | 217 | This·is·the·default·form·of·run: |
218 | $·python·-m·examples.performance·single_inserts | 218 | $·python·-m·examples.performance·single_inserts |
219 | Tests·to·run:·test_orm_commit,·test_bulk_save, | 219 | Tests·to·run:·test_orm_commit,·test_bulk_save, |
220 | ··············test_bulk_insert_dictionaries,·test_core, | 220 | ··············test_bulk_insert_dictionaries,·test_core, |
221 | ··············test_core_query_caching,·test_dbapi_raw_w_connect, | 221 | ··············test_core_query_caching,·test_dbapi_raw_w_connect, |
222 | ··············test_dbapi_raw_w_pool | 222 | ··············test_dbapi_raw_w_pool |
Offset 353, 20 lines modified | Offset 353, 20 lines modified | ||
353 | total·time·2.754592·sec | 353 | total·time·2.754592·sec |
354 | test_subqueryload·:·load·everything,·subquery·eager·loading.·(1000·iterations); | 354 | test_subqueryload·:·load·everything,·subquery·eager·loading.·(1000·iterations); |
355 | total·time·2.977696·sec | 355 | total·time·2.977696·sec |
356 | ****·Relationship·Join·Conditions¶·**** | 356 | ****·Relationship·Join·Conditions¶·**** |
357 | Examples·of·various·relationship()·configurations,·which·make·use·of·the | 357 | Examples·of·various·relationship()·configurations,·which·make·use·of·the |
358 | primaryjoin·argument·to·compose·special·types·of·join·conditions. | 358 | primaryjoin·argument·to·compose·special·types·of·join·conditions. |
359 | Listing·of·files: | 359 | Listing·of·files: |
360 | ····*·threeway.py·-·Illustrate·a·“three·way·join”·-·where·a·primary·table·joins | ||
361 | ······to·a·remote·table·via·an·association·table,·but·then·the·primary·table | ||
362 | ······also·needs·to·refer·to·some·columns·in·the·remote·table·directly. | ||
363 | cast.py·-·Illustrate·a·relationship()·that·joins·two·columns·where·those | 360 | ····*·cast.py·-·Illustrate·a·relationship()·that·joins·two·columns·where·those |
364 | columns·are·not·of·the·same·type,·and·a·CAST·must·be·used·on·the·SQL·side | 361 | ······columns·are·not·of·the·same·type,·and·a·CAST·must·be·used·on·the·SQL·side |
365 | order·to·match·them. | 362 | ······in·order·to·match·them. |
363 | threeway.py·-·Illustrate·a·“three·way·join”·-·where·a·primary·table·joins·to·a | ||
364 | remote·table·via·an·association·table,·but·then·the·primary·table·also·needs·to | ||
365 | refer·to·some·columns·in·the·remote·table·directly. | ||
366 | ****·Space·Invaders¶·**** | 366 | ****·Space·Invaders¶·**** |
367 | A·Space·Invaders·game·using·SQLite·as·the·state·machine. | 367 | A·Space·Invaders·game·using·SQLite·as·the·state·machine. |
368 | Originally·developed·in·2012.·Adapted·to·work·in·Python·3. | 368 | Originally·developed·in·2012.·Adapted·to·work·in·Python·3. |
369 | Runs·in·a·textual·console·using·ASCII·art. | 369 | Runs·in·a·textual·console·using·ASCII·art. |
370 | [orm/space_invaders.jpg] | 370 | [orm/space_invaders.jpg] |
371 | To·run: | 371 | To·run: |
372 | python·-m·examples.space_invaders.space_invaders | 372 | python·-m·examples.space_invaders.space_invaders |
Offset 469, 38 lines modified | Offset 469, 39 lines modified | ||
Max diff block lines reached; 5595/13394 bytes (41.77%) of diff not shown. |