Offset 1, 5 lines modified | Offset 1, 5 lines modified | ||
1 | · | 1 | ·89b1325fb12299b5988c53dfc12d4a91·3987632·doc·optional·python-sqlalchemy-doc_2.0.40+ds1-1_all.deb |
2 | ·856814a65ad466f43501f4a07be4367b·919236·debug·optional·python3-sqlalchemy-ext-dbgsym_2.0.40+ds1-1_amd64.deb | 2 | ·856814a65ad466f43501f4a07be4367b·919236·debug·optional·python3-sqlalchemy-ext-dbgsym_2.0.40+ds1-1_amd64.deb |
3 | ·1be620144e503b8dbd1a14e2d7a27a64·153012·python·optional·python3-sqlalchemy-ext_2.0.40+ds1-1_amd64.deb | 3 | ·1be620144e503b8dbd1a14e2d7a27a64·153012·python·optional·python3-sqlalchemy-ext_2.0.40+ds1-1_amd64.deb |
4 | ·8aaa3be24daec5bb97aecb6139c4ede1·1210292·python·optional·python3-sqlalchemy_2.0.40+ds1-1_all.deb | 4 | ·8aaa3be24daec5bb97aecb6139c4ede1·1210292·python·optional·python3-sqlalchemy_2.0.40+ds1-1_all.deb |
Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | -rw-r--r--···0········0········0········4·2025-02-06·11:19:07.000000·debian-binary | 1 | -rw-r--r--···0········0········0········4·2025-02-06·11:19:07.000000·debian-binary |
2 | -rw-r--r--···0········0········0····1368 | 2 | -rw-r--r--···0········0········0····13680·2025-02-06·11:19:07.000000·control.tar.xz |
3 | -rw-r--r--···0········0········0··3973 | 3 | -rw-r--r--···0········0········0··3973760·2025-02-06·11:19:07.000000·data.tar.xz |
Offset 9314, 22 lines modified | Offset 9314, 15 lines modified | ||
9314 | <div·class="admonition·seealso"> | 9314 | <div·class="admonition·seealso"> |
9315 | <p·class="admonition-title">See·also</p> | 9315 | <p·class="admonition-title">See·also</p> |
9316 | <p><a·class="reference·internal"·href="migration_14.html#change-4710-core"><span·class="std·std-ref">RowProxy·is·no·longer·a·“proxy”;·is·now·called·Row·and·behaves·like·an·enhanced·named·tuple</span></a></p> | 9316 | <p><a·class="reference·internal"·href="migration_14.html#change-4710-core"><span·class="std·std-ref">RowProxy·is·no·longer·a·“proxy”;·is·now·called·Row·and·behaves·like·an·enhanced·named·tuple</span></a></p> |
9317 | </div> | 9317 | </div> |
9318 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/4710">#4710</a></p> | 9318 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/4710">#4710</a></p> |
9319 | </p> | 9319 | </p> |
9320 | </li> | 9320 | </li> |
9321 | <li><p·class="caption"·id="change-1.4.0b1-54"><span·class="target"·id="change-6bc91a2bef8d8afd244e6dbd38439c4d"><strong>[engine]·[performance]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-6bc91a2bef8d8afd244e6dbd38439c4d">¶</a></span><p>The·pool·“pre-ping”·feature·has·been·refined·to·not·invoke·for·a·DBAPI | ||
9322 | connection·that·was·just·opened·in·the·same·checkout·operation.··pre·ping | ||
9323 | only·applies·to·a·DBAPI·connection·that’s·been·checked·into·the·pool | ||
9324 | and·is·being·checked·out·again.</p> | ||
9325 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/4524">#4524</a></p> | ||
9326 | </p> | ||
9327 | </li> | ||
9328 | <li><p·class="caption"·id="change-1.4.0b1-5 | 9321 | <li><p·class="caption"·id="change-1.4.0b1-54"><span·class="target"·id="change-d3650b27f4c852ac687ea55326051ed0"><strong>[engine]·[change]·[performance]·[py3k]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-d3650b27f4c852ac687ea55326051ed0">¶</a></span><p>Disabled·the·“unicode·returns”·check·that·runs·on·dialect·startup·when |
9329 | running·under·Python·3,·which·for·many·years·has·occurred·in·order·to·test | 9322 | running·under·Python·3,·which·for·many·years·has·occurred·in·order·to·test |
9330 | the·current·DBAPI’s·behavior·for·whether·or·not·it·returns·Python·Unicode | 9323 | the·current·DBAPI’s·behavior·for·whether·or·not·it·returns·Python·Unicode |
9331 | or·Py2K·strings·for·the·VARCHAR·and·NVARCHAR·datatypes.··The·check·still | 9324 | or·Py2K·strings·for·the·VARCHAR·and·NVARCHAR·datatypes.··The·check·still |
9332 | occurs·by·default·under·Python·2,·however·the·mechanism·to·test·the | 9325 | occurs·by·default·under·Python·2,·however·the·mechanism·to·test·the |
9333 | behavior·will·be·removed·in·SQLAlchemy·2.0·when·Python·2·support·is·also | 9326 | behavior·will·be·removed·in·SQLAlchemy·2.0·when·Python·2·support·is·also |
9334 | removed.</p> | 9327 | removed.</p> |
9335 | <p>This·logic·was·very·effective·when·it·was·needed,·however·now·that·Python·3 | 9328 | <p>This·logic·was·very·effective·when·it·was·needed,·however·now·that·Python·3 |
Offset 9340, 14 lines modified | Offset 9333, 21 lines modified | ||
9340 | dialect·flags·by·setting·the·dialect·level·flag·<code·class="docutils·literal·notranslate"><span·class="pre">returns_unicode_strings</span></code> | 9333 | dialect·flags·by·setting·the·dialect·level·flag·<code·class="docutils·literal·notranslate"><span·class="pre">returns_unicode_strings</span></code> |
9341 | to·one·of·<code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">String.RETURNS_CONDITIONAL</span></code>·or | 9334 | to·one·of·<code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">String.RETURNS_CONDITIONAL</span></code>·or |
9342 | <code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">String.RETURNS_BYTES</span></code>,·both·of·which·will·enable·Unicode·conversion | 9335 | <code·class="xref·py·py-attr·docutils·literal·notranslate"><span·class="pre">String.RETURNS_BYTES</span></code>,·both·of·which·will·enable·Unicode·conversion |
9343 | even·under·Python·3.</p> | 9336 | even·under·Python·3.</p> |
9344 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/5315">#5315</a></p> | 9337 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/5315">#5315</a></p> |
9345 | </p> | 9338 | </p> |
9346 | </li> | 9339 | </li> |
9340 | <li><p·class="caption"·id="change-1.4.0b1-55"><span·class="target"·id="change-6bc91a2bef8d8afd244e6dbd38439c4d"><strong>[engine]·[performance]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-6bc91a2bef8d8afd244e6dbd38439c4d">¶</a></span><p>The·pool·“pre-ping”·feature·has·been·refined·to·not·invoke·for·a·DBAPI | ||
9341 | connection·that·was·just·opened·in·the·same·checkout·operation.··pre·ping | ||
9342 | only·applies·to·a·DBAPI·connection·that’s·been·checked·into·the·pool | ||
9343 | and·is·being·checked·out·again.</p> | ||
9344 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/4524">#4524</a></p> | ||
9345 | </p> | ||
9346 | </li> | ||
9347 | <li><p·class="caption"·id="change-1.4.0b1-56"><span·class="target"·id="change-f8a130923cff752e26f7be9cf1ea18eb"><strong>[engine]·[bug]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-f8a130923cff752e26f7be9cf1ea18eb">¶</a></span><p>Revised·the·<a·class="reference·internal"·href="../core/connections.html#sqlalchemy.engine.Connection.execution_options.params.schema_translate_map"·title="sqlalchemy.engine.Connection.execution_options"><code·class="xref·py·py-paramref·docutils·literal·notranslate"><span·class="pre">Connection.execution_options.schema_translate_map</span></code></a> | 9347 | <li><p·class="caption"·id="change-1.4.0b1-56"><span·class="target"·id="change-f8a130923cff752e26f7be9cf1ea18eb"><strong>[engine]·[bug]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-f8a130923cff752e26f7be9cf1ea18eb">¶</a></span><p>Revised·the·<a·class="reference·internal"·href="../core/connections.html#sqlalchemy.engine.Connection.execution_options.params.schema_translate_map"·title="sqlalchemy.engine.Connection.execution_options"><code·class="xref·py·py-paramref·docutils·literal·notranslate"><span·class="pre">Connection.execution_options.schema_translate_map</span></code></a> |
9348 | feature·such·that·the·processing·of·the·SQL·statement·to·receive·a·specific | 9348 | feature·such·that·the·processing·of·the·SQL·statement·to·receive·a·specific |
9349 | schema·name·occurs·within·the·execution·phase·of·the·statement,·rather·than | 9349 | schema·name·occurs·within·the·execution·phase·of·the·statement,·rather·than |
9350 | at·the·compile·phase.···This·is·to·support·the·statement·being·efficiently | 9350 | at·the·compile·phase.···This·is·to·support·the·statement·being·efficiently |
9351 | cached.···Previously,·the·current·schema·being·rendered·into·the·statement | 9351 | cached.···Previously,·the·current·schema·being·rendered·into·the·statement |
9352 | for·a·particular·run·would·be·considered·as·part·of·the·cache·key·itself, | 9352 | for·a·particular·run·would·be·considered·as·part·of·the·cache·key·itself, |
9353 | meaning·that·for·a·run·against·hundreds·of·schemas,·there·would·be·hundreds | 9353 | meaning·that·for·a·run·against·hundreds·of·schemas,·there·would·be·hundreds |
Offset 6406, 21 lines modified | Offset 6406, 15 lines modified | ||
6406 | returned·by·the·ResultProxy·is·now·the·LegacyRow·subclass,·which·maintains | 6406 | returned·by·the·ResultProxy·is·now·the·LegacyRow·subclass,·which·maintains |
6407 | mapping/tuple·hybrid·behavior,·however·the·base·_\x8R_\x8o_\x8w·class·now·behaves·more | 6407 | mapping/tuple·hybrid·behavior,·however·the·base·_\x8R_\x8o_\x8w·class·now·behaves·more |
6408 | fully·like·a·named·tuple. | 6408 | fully·like·a·named·tuple. |
6409 | See·also | 6409 | See·also |
6410 | _\x8R_\x8o_\x8w_\x8P_\x8r_\x8o_\x8x_\x8y_\x8·_\x8i_\x8s_\x8·_\x8n_\x8o_\x8·_\x8l_\x8o_\x8n_\x8g_\x8e_\x8r_\x8·_\x8a_\x8·_\x8“_\x8p_\x8r_\x8o_\x8x_\x8y_\x8”_\x8;_\x8·_\x8i_\x8s_\x8·_\x8n_\x8o_\x8w_\x8·_\x8c_\x8a_\x8l_\x8l_\x8e_\x8d_\x8·_\x8R_\x8o_\x8w_\x8·_\x8a_\x8n_\x8d_\x8·_\x8b_\x8e_\x8h_\x8a_\x8v_\x8e_\x8s_\x8·_\x8l_\x8i_\x8k_\x8e_\x8·_\x8a_\x8n_\x8·_\x8e_\x8n_\x8h_\x8a_\x8n_\x8c_\x8e_\x8d | 6410 | _\x8R_\x8o_\x8w_\x8P_\x8r_\x8o_\x8x_\x8y_\x8·_\x8i_\x8s_\x8·_\x8n_\x8o_\x8·_\x8l_\x8o_\x8n_\x8g_\x8e_\x8r_\x8·_\x8a_\x8·_\x8“_\x8p_\x8r_\x8o_\x8x_\x8y_\x8”_\x8;_\x8·_\x8i_\x8s_\x8·_\x8n_\x8o_\x8w_\x8·_\x8c_\x8a_\x8l_\x8l_\x8e_\x8d_\x8·_\x8R_\x8o_\x8w_\x8·_\x8a_\x8n_\x8d_\x8·_\x8b_\x8e_\x8h_\x8a_\x8v_\x8e_\x8s_\x8·_\x8l_\x8i_\x8k_\x8e_\x8·_\x8a_\x8n_\x8·_\x8e_\x8n_\x8h_\x8a_\x8n_\x8c_\x8e_\x8d |
6411 | _\x8n_\x8a_\x8m_\x8e_\x8d_\x8·_\x8t_\x8u_\x8p_\x8l_\x8e | 6411 | _\x8n_\x8a_\x8m_\x8e_\x8d_\x8·_\x8t_\x8u_\x8p_\x8l_\x8e |
6412 | References:·_\x8#_\x84_\x87_\x81_\x80 | 6412 | References:·_\x8#_\x84_\x87_\x81_\x80 |
6413 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[p\x8pe\x8er\x8rf\x8fo\x8or\x8rm\x8ma\x8an\x8nc\x8ce\x8e]\x8]·_\x8¶ | ||
6414 | The·pool·“pre-ping”·feature·has·been·refined·to·not·invoke·for·a·DBAPI | ||
6415 | connection·that·was·just·opened·in·the·same·checkout·operation.·pre·ping·only | ||
6416 | applies·to·a·DBAPI·connection·that’s·been·checked·into·the·pool·and·is·being | ||
6417 | checked·out·again. | ||
6418 | References:·_\x8#_\x84_\x85_\x82_\x84 | ||
6419 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[ | 6413 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[c.ch.ha.an.ng.ge.e].]·[.[p.pe.er.rf.fo.or.rm.ma.an.nc.ce\x8e]\x8]·[\x8[p\x8py\x8y3\x83k\x8k]\x8]·_\x8¶ |
6420 | Disabled·the·“unicode·returns”·check·that·runs·on·dialect·startup·when·running | 6414 | Disabled·the·“unicode·returns”·check·that·runs·on·dialect·startup·when·running |
6421 | under·Python·3,·which·for·many·years·has·occurred·in·order·to·test·the·current | 6415 | under·Python·3,·which·for·many·years·has·occurred·in·order·to·test·the·current |
6422 | DBAPI’s·behavior·for·whether·or·not·it·returns·Python·Unicode·or·Py2K·strings | 6416 | DBAPI’s·behavior·for·whether·or·not·it·returns·Python·Unicode·or·Py2K·strings |
6423 | for·the·VARCHAR·and·NVARCHAR·datatypes.·The·check·still·occurs·by·default·under | 6417 | for·the·VARCHAR·and·NVARCHAR·datatypes.·The·check·still·occurs·by·default·under |
6424 | Python·2,·however·the·mechanism·to·test·the·behavior·will·be·removed·in | 6418 | Python·2,·however·the·mechanism·to·test·the·behavior·will·be·removed·in |
6425 | SQLAlchemy·2.0·when·Python·2·support·is·also·removed. | 6419 | SQLAlchemy·2.0·when·Python·2·support·is·also·removed. |
6426 | This·logic·was·very·effective·when·it·was·needed,·however·now·that·Python·3·is | 6420 | This·logic·was·very·effective·when·it·was·needed,·however·now·that·Python·3·is |
Offset 6428, 14 lines modified | Offset 6422, 20 lines modified | ||
6428 | datatypes.·In·the·unlikely·case·that·a·third·party·DBAPI·does·not·support·this, | 6422 | datatypes.·In·the·unlikely·case·that·a·third·party·DBAPI·does·not·support·this, |
6429 | the·conversion·logic·within·_\x8S_\x8t_\x8r_\x8i_\x8n_\x8g·is·still·available·and·the·third·party | 6423 | the·conversion·logic·within·_\x8S_\x8t_\x8r_\x8i_\x8n_\x8g·is·still·available·and·the·third·party |
6430 | dialect·may·specify·this·in·its·upfront·dialect·flags·by·setting·the·dialect | 6424 | dialect·may·specify·this·in·its·upfront·dialect·flags·by·setting·the·dialect |
6431 | level·flag·returns_unicode_strings·to·one·of·String.RETURNS_CONDITIONAL·or | 6425 | level·flag·returns_unicode_strings·to·one·of·String.RETURNS_CONDITIONAL·or |
6432 | String.RETURNS_BYTES,·both·of·which·will·enable·Unicode·conversion·even·under | 6426 | String.RETURNS_BYTES,·both·of·which·will·enable·Unicode·conversion·even·under |
6433 | Python·3. | 6427 | Python·3. |
6434 | References:·_\x8#_\x85_\x83_\x81_\x85 | 6428 | References:·_\x8#_\x85_\x83_\x81_\x85 |
6429 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[p\x8pe\x8er\x8rf\x8fo\x8or\x8rm\x8ma\x8an\x8nc\x8ce\x8e]\x8]·_\x8¶ | ||
6430 | The·pool·“pre-ping”·feature·has·been·refined·to·not·invoke·for·a·DBAPI | ||
6431 | connection·that·was·just·opened·in·the·same·checkout·operation.·pre·ping·only | ||
6432 | applies·to·a·DBAPI·connection·that’s·been·checked·into·the·pool·and·is·being | ||
6433 | checked·out·again. | ||
6434 | References:·_\x8#_\x84_\x85_\x82_\x84 | ||
6435 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[b\x8bu\x8ug\x8g]\x8]·_\x8¶ | 6435 | [\x8[e\x8en\x8ng\x8gi\x8in\x8ne\x8e]\x8]·[\x8[b\x8bu\x8ug\x8g]\x8]·_\x8¶ |
6436 | Revised·the·_\x8C_\x8o_\x8n_\x8n_\x8e_\x8c_\x8t_\x8i_\x8o_\x8n_\x8._\x8e_\x8x_\x8e_\x8c_\x8u_\x8t_\x8i_\x8o_\x8n_\x8__\x8o_\x8p_\x8t_\x8i_\x8o_\x8n_\x8s_\x8._\x8s_\x8c_\x8h_\x8e_\x8m_\x8a_\x8__\x8t_\x8r_\x8a_\x8n_\x8s_\x8l_\x8a_\x8t_\x8e_\x8__\x8m_\x8a_\x8p·feature·such·that | 6436 | Revised·the·_\x8C_\x8o_\x8n_\x8n_\x8e_\x8c_\x8t_\x8i_\x8o_\x8n_\x8._\x8e_\x8x_\x8e_\x8c_\x8u_\x8t_\x8i_\x8o_\x8n_\x8__\x8o_\x8p_\x8t_\x8i_\x8o_\x8n_\x8s_\x8._\x8s_\x8c_\x8h_\x8e_\x8m_\x8a_\x8__\x8t_\x8r_\x8a_\x8n_\x8s_\x8l_\x8a_\x8t_\x8e_\x8__\x8m_\x8a_\x8p·feature·such·that |
6437 | the·processing·of·the·SQL·statement·to·receive·a·specific·schema·name·occurs | 6437 | the·processing·of·the·SQL·statement·to·receive·a·specific·schema·name·occurs |
6438 | within·the·execution·phase·of·the·statement,·rather·than·at·the·compile·phase. | 6438 | within·the·execution·phase·of·the·statement,·rather·than·at·the·compile·phase. |
6439 | This·is·to·support·the·statement·being·efficiently·cached.·Previously,·the | 6439 | This·is·to·support·the·statement·being·efficiently·cached.·Previously,·the |
6440 | current·schema·being·rendered·into·the·statement·for·a·particular·run·would·be | 6440 | current·schema·being·rendered·into·the·statement·for·a·particular·run·would·be |
6441 | considered·as·part·of·the·cache·key·itself,·meaning·that·for·a·run·against | 6441 | considered·as·part·of·the·cache·key·itself,·meaning·that·for·a·run·against |
Offset 8985, 45 lines modified | Offset 8985, 45 lines modified | ||
8985 | </p> | 8985 | </p> |
8986 | </li> | 8986 | </li> |
8987 | <li><p·class="caption"·id="change-2.0.0b1-85"><span·class="target"·id="change-0a487b939ab3ad7ca93ee291b91eb410"><strong>[sqlite]·[usecase]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-0a487b939ab3ad7ca93ee291b91eb410">¶</a></span><p>Added·RETURNING·support·for·the·SQLite·dialect.··SQLite·supports·RETURNING | 8987 | <li><p·class="caption"·id="change-2.0.0b1-85"><span·class="target"·id="change-0a487b939ab3ad7ca93ee291b91eb410"><strong>[sqlite]·[usecase]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-0a487b939ab3ad7ca93ee291b91eb410">¶</a></span><p>Added·RETURNING·support·for·the·SQLite·dialect.··SQLite·supports·RETURNING |
8988 | since·version·3.35.</p> | 8988 | since·version·3.35.</p> |
8989 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/6195">#6195</a></p> | 8989 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/6195">#6195</a></p> |
8990 | </p> | 8990 | </p> |
8991 | </li> | 8991 | </li> |
8992 | <li><p·class="caption"·id="change-2.0.0b1-86"><span·class="target"·id="change-74fee584f531c832d0d97ea94be754b8"><strong>[sqlite]·[usecase]·[performance]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-74fee584f531c832d0d97ea94be754b8">¶</a></span><p>SQLite·datetime,·date,·and·time·datatypes·now·use·Python·standard·lib | ||
8993 | <code·class="docutils·literal·notranslate"><span·class="pre">fromisoformat()</span></code>·methods·in·order·to·parse·incoming·datetime,·date,·and | ||
8994 | time·string·values.·This·improves·performance·vs.·the·previous·regular | ||
8995 | expression-based·approach,·and·also·automatically·accommodates·for·datetime | ||
8996 | and·time·formats·that·contain·either·a·six-digit·“microseconds”·format·or·a | ||
8997 | three-digit·“milliseconds”·format.</p> | ||
8998 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7029">#7029</a></p> | ||
8999 | </p> | ||
9000 | </li> | ||
9001 | <li><p·class="caption"·id="change-2.0.0b1-8 | 8992 | <li><p·class="caption"·id="change-2.0.0b1-86"><span·class="target"·id="change-ef6ce799a34b30832a9c8115e2afa920"><strong>[sqlite]·[usecase]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-ef6ce799a34b30832a9c8115e2afa920">¶</a></span><p>The·SQLite·dialect·now·supports·UPDATE..FROM·syntax,·for·UPDATE·statements |
9002 | that·may·refer·to·additional·tables·within·the·WHERE·criteria·of·the | 8993 | that·may·refer·to·additional·tables·within·the·WHERE·criteria·of·the |
9003 | statement·without·the·need·to·use·subqueries.·This·syntax·is·invoked | 8994 | statement·without·the·need·to·use·subqueries.·This·syntax·is·invoked |
9004 | automatically·when·using·the·<a·class="reference·internal"·href="../core/dml.html#sqlalchemy.sql.expression.Update"·title="sqlalchemy.sql.expression.Update"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Update</span></code></a>·construct·when·more·than | 8995 | automatically·when·using·the·<a·class="reference·internal"·href="../core/dml.html#sqlalchemy.sql.expression.Update"·title="sqlalchemy.sql.expression.Update"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Update</span></code></a>·construct·when·more·than |
9005 | one·table·or·other·entity·or·selectable·is·used.</p> | 8996 | one·table·or·other·entity·or·selectable·is·used.</p> |
9006 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7185">#7185</a></p> | 8997 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7185">#7185</a></p> |
9007 | </p> | 8998 | </p> |
9008 | </li> | 8999 | </li> |
9009 | <li><p·class="caption"·id="change-2.0.0b1-8 | 9000 | <li><p·class="caption"·id="change-2.0.0b1-87"><span·class="target"·id="change-aba109875059299e0eb82359b5825416"><strong>[sqlite]·[performance]·[bug]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-aba109875059299e0eb82359b5825416">¶</a></span><p>The·SQLite·dialect·now·defaults·to·<a·class="reference·internal"·href="../core/pooling.html#sqlalchemy.pool.QueuePool"·title="sqlalchemy.pool.QueuePool"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">QueuePool</span></code></a>·when·a·file |
9010 | based·database·is·used.·This·is·set·along·with·setting·the | 9001 | based·database·is·used.·This·is·set·along·with·setting·the |
9011 | <code·class="docutils·literal·notranslate"><span·class="pre">check_same_thread</span></code>·parameter·to·<code·class="docutils·literal·notranslate"><span·class="pre">False</span></code>.·It·has·been·observed·that·the | 9002 | <code·class="docutils·literal·notranslate"><span·class="pre">check_same_thread</span></code>·parameter·to·<code·class="docutils·literal·notranslate"><span·class="pre">False</span></code>.·It·has·been·observed·that·the |
9012 | previous·approach·of·defaulting·to·<a·class="reference·internal"·href="../core/pooling.html#sqlalchemy.pool.NullPool"·title="sqlalchemy.pool.NullPool"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">NullPool</span></code></a>,·which·does·not | 9003 | previous·approach·of·defaulting·to·<a·class="reference·internal"·href="../core/pooling.html#sqlalchemy.pool.NullPool"·title="sqlalchemy.pool.NullPool"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">NullPool</span></code></a>,·which·does·not |
9013 | hold·onto·database·connections·after·they·are·released,·did·in·fact·have·a | 9004 | hold·onto·database·connections·after·they·are·released,·did·in·fact·have·a |
9014 | measurable·negative·performance·impact.·As·always,·the·pool·class·is | 9005 | measurable·negative·performance·impact.·As·always,·the·pool·class·is |
9015 | customizable·via·the·<a·class="reference·internal"·href="../core/engines.html#sqlalchemy.create_engine.params.poolclass"·title="sqlalchemy.create_engine"><code·class="xref·py·py-paramref·docutils·literal·notranslate"><span·class="pre">create_engine.poolclass</span></code></a>·parameter.</p> | 9006 | customizable·via·the·<a·class="reference·internal"·href="../core/engines.html#sqlalchemy.create_engine.params.poolclass"·title="sqlalchemy.create_engine"><code·class="xref·py·py-paramref·docutils·literal·notranslate"><span·class="pre">create_engine.poolclass</span></code></a>·parameter.</p> |
9016 | <div·class="admonition·seealso"> | 9007 | <div·class="admonition·seealso"> |
9017 | <p·class="admonition-title">See·also</p> | 9008 | <p·class="admonition-title">See·also</p> |
9018 | <p><a·class="reference·internal"·href="whatsnew_20.html#change-7490"><span·class="std·std-ref">The·SQLite·dialect·uses·QueuePool·for·file-based·databases</span></a></p> | 9009 | <p><a·class="reference·internal"·href="whatsnew_20.html#change-7490"><span·class="std·std-ref">The·SQLite·dialect·uses·QueuePool·for·file-based·databases</span></a></p> |
9019 | </div> | 9010 | </div> |
9020 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7490">#7490</a></p> | 9011 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7490">#7490</a></p> |
9021 | </p> | 9012 | </p> |
9022 | </li> | 9013 | </li> |
9014 | <li><p·class="caption"·id="change-2.0.0b1-88"><span·class="target"·id="change-74fee584f531c832d0d97ea94be754b8"><strong>[sqlite]·[performance]·[usecase]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-74fee584f531c832d0d97ea94be754b8">¶</a></span><p>SQLite·datetime,·date,·and·time·datatypes·now·use·Python·standard·lib | ||
9015 | <code·class="docutils·literal·notranslate"><span·class="pre">fromisoformat()</span></code>·methods·in·order·to·parse·incoming·datetime,·date,·and | ||
9016 | time·string·values.·This·improves·performance·vs.·the·previous·regular | ||
9017 | expression-based·approach,·and·also·automatically·accommodates·for·datetime | ||
9018 | and·time·formats·that·contain·either·a·six-digit·“microseconds”·format·or·a | ||
9019 | three-digit·“milliseconds”·format.</p> | ||
9020 | <p>References:·<a·class="reference·external"·href="https://www.sqlalchemy.org/trac/ticket/7029">#7029</a></p> | ||
9021 | </p> | ||
9022 | </li> | ||
9023 | <li><p·class="caption"·id="change-2.0.0b1-89"><span·class="target"·id="change-b11607250a6e056103e2b2d1205be1a8"><strong>[sqlite]·[bug]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-b11607250a6e056103e2b2d1205be1a8">¶</a></span><p>Removed·the·warning·that·emits·from·the·<a·class="reference·internal"·href="../core/type_basics.html#sqlalchemy.types.Numeric"·title="sqlalchemy.types.Numeric"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Numeric</span></code></a>·type·about | 9023 | <li><p·class="caption"·id="change-2.0.0b1-89"><span·class="target"·id="change-b11607250a6e056103e2b2d1205be1a8"><strong>[sqlite]·[bug]</strong>·<a·class="changelog-reference·headerlink·reference·internal"·href="#change-b11607250a6e056103e2b2d1205be1a8">¶</a></span><p>Removed·the·warning·that·emits·from·the·<a·class="reference·internal"·href="../core/type_basics.html#sqlalchemy.types.Numeric"·title="sqlalchemy.types.Numeric"><code·class="xref·py·py-class·docutils·literal·notranslate"><span·class="pre">Numeric</span></code></a>·type·about |
9024 | DBAPIs·not·supporting·Decimal·values·natively.·This·warning·was·oriented | 9024 | DBAPIs·not·supporting·Decimal·values·natively.·This·warning·was·oriented |
9025 | towards·SQLite,·which·does·not·have·any·real·way·without·additional | 9025 | towards·SQLite,·which·does·not·have·any·real·way·without·additional |
9026 | extensions·or·workarounds·of·handling·precision·numeric·values·more·than·15 | 9026 | extensions·or·workarounds·of·handling·precision·numeric·values·more·than·15 |
9027 | significant·digits·as·it·only·uses·floating·point·math·to·represent | 9027 | significant·digits·as·it·only·uses·floating·point·math·to·represent |
9028 | numbers.·As·this·is·a·known·and·documented·limitation·in·SQLite·itself,·and | 9028 | numbers.·As·this·is·a·known·and·documented·limitation·in·SQLite·itself,·and |
9029 | not·a·quirk·of·the·pysqlite·driver,·there’s·no·need·for·SQLAlchemy·to·warn | 9029 | not·a·quirk·of·the·pysqlite·driver,·there’s·no·need·for·SQLAlchemy·to·warn |
Offset 6179, 22 lines modified | Offset 6179, 14 lines modified | ||
6179 | ······See·also | 6179 | ······See·also |
6180 | ······_\x8R_\x8e_\x8f_\x8l_\x8e_\x8c_\x8t_\x8i_\x8n_\x8g_\x8·_\x8i_\x8n_\x8t_\x8e_\x8r_\x8n_\x8a_\x8l_\x8·_\x8s_\x8c_\x8h_\x8e_\x8m_\x8a_\x8·_\x8t_\x8a_\x8b_\x8l_\x8e_\x8s | 6180 | ······_\x8R_\x8e_\x8f_\x8l_\x8e_\x8c_\x8t_\x8i_\x8n_\x8g_\x8·_\x8i_\x8n_\x8t_\x8e_\x8r_\x8n_\x8a_\x8l_\x8·_\x8s_\x8c_\x8h_\x8e_\x8m_\x8a_\x8·_\x8t_\x8a_\x8b_\x8l_\x8e_\x8s |
6181 | ······References:·_\x8#_\x88_\x82_\x83_\x84 | 6181 | ······References:·_\x8#_\x88_\x82_\x83_\x84 |
6182 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·_\x8¶ | 6182 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·_\x8¶ |
6183 | Added·RETURNING·support·for·the·SQLite·dialect.·SQLite·supports·RETURNING·since | 6183 | Added·RETURNING·support·for·the·SQLite·dialect.·SQLite·supports·RETURNING·since |
6184 | version·3.35. | 6184 | version·3.35. |
6185 | References:·_\x8#_\x86_\x81_\x89_\x85 | 6185 | References:·_\x8#_\x86_\x81_\x89_\x85 |
6186 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·[\x8[p\x8pe\x8er\x8rf\x8fo\x8or\x8rm\x8ma\x8an\x8nc\x8ce\x8e]\x8]·_\x8¶ | ||
6187 | SQLite·datetime,·date,·and·time·datatypes·now·use·Python·standard·lib | ||
6188 | fromisoformat()·methods·in·order·to·parse·incoming·datetime,·date,·and·time | ||
6189 | string·values.·This·improves·performance·vs.·the·previous·regular·expression- | ||
6190 | based·approach,·and·also·automatically·accommodates·for·datetime·and·time | ||
6191 | formats·that·contain·either·a·six-digit·“microseconds”·format·or·a·three-digit | ||
6192 | “milliseconds”·format. | ||
6193 | References:·_\x8#_\x87_\x80_\x82_\x89 | ||
6194 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·_\x8¶ | 6186 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·_\x8¶ |
6195 | The·SQLite·dialect·now·supports·UPDATE..FROM·syntax,·for·UPDATE·statements·that | 6187 | The·SQLite·dialect·now·supports·UPDATE..FROM·syntax,·for·UPDATE·statements·that |
6196 | may·refer·to·additional·tables·within·the·WHERE·criteria·of·the·statement | 6188 | may·refer·to·additional·tables·within·the·WHERE·criteria·of·the·statement |
6197 | without·the·need·to·use·subqueries.·This·syntax·is·invoked·automatically·when | 6189 | without·the·need·to·use·subqueries.·This·syntax·is·invoked·automatically·when |
6198 | using·the·_\x8U_\x8p_\x8d_\x8a_\x8t_\x8e·construct·when·more·than·one·table·or·other·entity·or | 6190 | using·the·_\x8U_\x8p_\x8d_\x8a_\x8t_\x8e·construct·when·more·than·one·table·or·other·entity·or |
6199 | selectable·is·used. | 6191 | selectable·is·used. |
6200 | References:·_\x8#_\x87_\x81_\x88_\x85 | 6192 | References:·_\x8#_\x87_\x81_\x88_\x85 |
Offset 6204, 14 lines modified | Offset 6196, 22 lines modified | ||
6204 | It·has·been·observed·that·the·previous·approach·of·defaulting·to·_\x8N_\x8u_\x8l_\x8l_\x8P_\x8o_\x8o_\x8l, | 6196 | It·has·been·observed·that·the·previous·approach·of·defaulting·to·_\x8N_\x8u_\x8l_\x8l_\x8P_\x8o_\x8o_\x8l, |
6205 | which·does·not·hold·onto·database·connections·after·they·are·released,·did·in | 6197 | which·does·not·hold·onto·database·connections·after·they·are·released,·did·in |
6206 | fact·have·a·measurable·negative·performance·impact.·As·always,·the·pool·class | 6198 | fact·have·a·measurable·negative·performance·impact.·As·always,·the·pool·class |
6207 | is·customizable·via·the·_\x8c_\x8r_\x8e_\x8a_\x8t_\x8e_\x8__\x8e_\x8n_\x8g_\x8i_\x8n_\x8e_\x8._\x8p_\x8o_\x8o_\x8l_\x8c_\x8l_\x8a_\x8s_\x8s·parameter. | 6199 | is·customizable·via·the·_\x8c_\x8r_\x8e_\x8a_\x8t_\x8e_\x8__\x8e_\x8n_\x8g_\x8i_\x8n_\x8e_\x8._\x8p_\x8o_\x8o_\x8l_\x8c_\x8l_\x8a_\x8s_\x8s·parameter. |
6208 | See·also | 6200 | See·also |
6209 | _\x8T_\x8h_\x8e_\x8·_\x8S_\x8Q_\x8L_\x8i_\x8t_\x8e_\x8·_\x8d_\x8i_\x8a_\x8l_\x8e_\x8c_\x8t_\x8·_\x8u_\x8s_\x8e_\x8s_\x8·_\x8Q_\x8u_\x8e_\x8u_\x8e_\x8P_\x8o_\x8o_\x8l_\x8·_\x8f_\x8o_\x8r_\x8·_\x8f_\x8i_\x8l_\x8e_\x8-_\x8b_\x8a_\x8s_\x8e_\x8d_\x8·_\x8d_\x8a_\x8t_\x8a_\x8b_\x8a_\x8s_\x8e_\x8s | 6201 | _\x8T_\x8h_\x8e_\x8·_\x8S_\x8Q_\x8L_\x8i_\x8t_\x8e_\x8·_\x8d_\x8i_\x8a_\x8l_\x8e_\x8c_\x8t_\x8·_\x8u_\x8s_\x8e_\x8s_\x8·_\x8Q_\x8u_\x8e_\x8u_\x8e_\x8P_\x8o_\x8o_\x8l_\x8·_\x8f_\x8o_\x8r_\x8·_\x8f_\x8i_\x8l_\x8e_\x8-_\x8b_\x8a_\x8s_\x8e_\x8d_\x8·_\x8d_\x8a_\x8t_\x8a_\x8b_\x8a_\x8s_\x8e_\x8s |
6210 | References:·_\x8#_\x87_\x84_\x89_\x80 | 6202 | References:·_\x8#_\x87_\x84_\x89_\x80 |
6203 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[p\x8pe\x8er\x8rf\x8fo\x8or\x8rm\x8ma\x8an\x8nc\x8ce\x8e]\x8]·[\x8[u\x8us\x8se\x8ec\x8ca\x8as\x8se\x8e]\x8]·_\x8¶ | ||
6204 | SQLite·datetime,·date,·and·time·datatypes·now·use·Python·standard·lib | ||
6205 | fromisoformat()·methods·in·order·to·parse·incoming·datetime,·date,·and·time | ||
6206 | string·values.·This·improves·performance·vs.·the·previous·regular·expression- | ||
6207 | based·approach,·and·also·automatically·accommodates·for·datetime·and·time | ||
6208 | formats·that·contain·either·a·six-digit·“microseconds”·format·or·a·three-digit | ||
6209 | “milliseconds”·format. | ||
6210 | References:·_\x8#_\x87_\x80_\x82_\x89 | ||
6211 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[b\x8bu\x8ug\x8g]\x8]·_\x8¶ | 6211 | [\x8[s\x8sq\x8ql\x8li\x8it\x8te\x8e]\x8]·[\x8[b\x8bu\x8ug\x8g]\x8]·_\x8¶ |
6212 | Removed·the·warning·that·emits·from·the·_\x8N_\x8u_\x8m_\x8e_\x8r_\x8i_\x8c·type·about·DBAPIs·not | 6212 | Removed·the·warning·that·emits·from·the·_\x8N_\x8u_\x8m_\x8e_\x8r_\x8i_\x8c·type·about·DBAPIs·not |
6213 | supporting·Decimal·values·natively.·This·warning·was·oriented·towards·SQLite, | 6213 | supporting·Decimal·values·natively.·This·warning·was·oriented·towards·SQLite, |
6214 | which·does·not·have·any·real·way·without·additional·extensions·or·workarounds | 6214 | which·does·not·have·any·real·way·without·additional·extensions·or·workarounds |
6215 | of·handling·precision·numeric·values·more·than·15·significant·digits·as·it·only | 6215 | of·handling·precision·numeric·values·more·than·15·significant·digits·as·it·only |
6216 | uses·floating·point·math·to·represent·numbers.·As·this·is·a·known·and | 6216 | uses·floating·point·math·to·represent·numbers.·As·this·is·a·known·and |
6217 | documented·limitation·in·SQLite·itself,·and·not·a·quirk·of·the·pysqlite·driver, | 6217 | documented·limitation·in·SQLite·itself,·and·not·a·quirk·of·the·pysqlite·driver, |
Offset 304, 44 lines modified | Offset 304, 44 lines modified | ||
304 | classes·that·are·associated·in·a·many-to-many·pattern.</p> | 304 | classes·that·are·associated·in·a·many-to-many·pattern.</p> |
305 | <p>Listing·of·files:<ul·class="simple"> | 305 | <p>Listing·of·files:<ul·class="simple"> |
306 | <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 | 306 | <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 |
307 | illustrates·nesting·of·association·proxies·to·produce·multi-level·Python | 307 | illustrates·nesting·of·association·proxies·to·produce·multi-level·Python |
308 | collections,·in·this·case·a·dictionary·with·string·keys·and·sets·of·integers | 308 | collections,·in·this·case·a·dictionary·with·string·keys·and·sets·of·integers |
309 | as·values,·which·conceal·the·underlying·mapped·classes.</p> | 309 | as·values,·which·conceal·the·underlying·mapped·classes.</p> |
310 | </p></li> | 310 | </p></li> |
311 | <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 | ||
312 | 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 | ||
313 | to·<code·class="docutils·literal·notranslate"><span·class="pre">OrderItem</span></code>·optional.</p> | ||
314 | </p></li> | ||
315 | <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 | 311 | <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 |
316 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price | 312 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price |
317 | with·each·via·an·association·object·called·“OrderItem”</p> | 313 | with·each·via·an·association·object·called·“OrderItem”</p> |
318 | </p></li> | 314 | </p></li> |
315 | <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 | ||
316 | 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 | ||
317 | to·<code·class="docutils·literal·notranslate"><span·class="pre">OrderItem</span></code>·optional.</p> | ||
318 | </p></li> | ||
319 | </ul> | 319 | </ul> |
320 | </p> | 320 | </p> |
321 | </section> | 321 | </section> |
322 | <section·id="module-examples.asyncio"> | 322 | <section·id="module-examples.asyncio"> |
323 | <span·id="asyncio-integration"></span><span·id="examples-asyncio"></span><h3>Asyncio·Integration<a·class="headerlink"·href="#module-examples.asyncio"·title="Link·to·this·heading">¶</a></h3> | 323 | <span·id="asyncio-integration"></span><span·id="examples-asyncio"></span><h3>Asyncio·Integration<a·class="headerlink"·href="#module-examples.asyncio"·title="Link·to·this·heading">¶</a></h3> |
324 | <p>Examples·illustrating·the·asyncio·engine·feature·of·SQLAlchemy.</p> | 324 | <p>Examples·illustrating·the·asyncio·engine·feature·of·SQLAlchemy.</p> |
325 | <p>Listing·of·files:<ul·class="simple"> | 325 | <p>Listing·of·files:<ul·class="simple"> |
326 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/async_orm.html">async_orm.py</a>·-·Illustrates·use·of·the·<code·class="docutils·literal·notranslate"><span·class="pre">sqlalchemy.ext.asyncio.AsyncSession</span></code>·object | ||
327 | for·asynchronous·ORM·use.</p> | ||
328 | </p></li> | ||
329 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/greenlet_orm.html">greenlet_orm.py</a>·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession·object | ||
330 | for·asynchronous·ORM·use,·including·the·optional·run_sync()·method.</p> | ||
331 | </p></li> | ||
326 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/gather_orm_statements.html">gather_orm_statements.py</a>·-·Illustrates·how·to·run·many·statements·concurrently·using·<code·class="docutils·literal·notranslate"><span·class="pre">asyncio.gather()</span></code> | 332 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/gather_orm_statements.html">gather_orm_statements.py</a>·-·Illustrates·how·to·run·many·statements·concurrently·using·<code·class="docutils·literal·notranslate"><span·class="pre">asyncio.gather()</span></code> |
327 | along·many·asyncio·database·connections,·merging·ORM·results·into·a·single | 333 | along·many·asyncio·database·connections,·merging·ORM·results·into·a·single |
328 | <code·class="docutils·literal·notranslate"><span·class="pre">AsyncSession</span></code>.</p> | 334 | <code·class="docutils·literal·notranslate"><span·class="pre">AsyncSession</span></code>.</p> |
329 | </p></li> | 335 | </p></li> |
330 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/async_orm.html">async_orm.py</a>·-·Illustrates·use·of·the·<code·class="docutils·literal·notranslate"><span·class="pre">sqlalchemy.ext.asyncio.AsyncSession</span></code>·object | ||
331 | for·asynchronous·ORM·use.</p> | ||
332 | </p></li> | ||
333 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/async_orm_writeonly.html">async_orm_writeonly.py</a>·-·Illustrates·using·<strong>write·only·relationships</strong>·for·simpler·handling | 336 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/async_orm_writeonly.html">async_orm_writeonly.py</a>·-·Illustrates·using·<strong>write·only·relationships</strong>·for·simpler·handling |
334 | of·ORM·collections·under·asyncio.</p> | 337 | of·ORM·collections·under·asyncio.</p> |
335 | </p></li> | 338 | </p></li> |
336 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/basic.html">basic.py</a>·-·Illustrates·the·asyncio·engine·/·connection·interface.</p> | 339 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/basic.html">basic.py</a>·-·Illustrates·the·asyncio·engine·/·connection·interface.</p> |
337 | </p></li> | 340 | </p></li> |
338 | <li><p><p><a·class="reference·external"·href="../_modules/examples/asyncio/greenlet_orm.html">greenlet_orm.py</a>·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession·object | ||
339 | for·asynchronous·ORM·use,·including·the·optional·run_sync()·method.</p> | ||
340 | </p></li> | ||
341 | </ul> | 341 | </ul> |
342 | </p> | 342 | </p> |
343 | </section> | 343 | </section> |
344 | <section·id="module-examples.graphs"> | 344 | <section·id="module-examples.graphs"> |
345 | <span·id="directed-graphs"></span><h3>Directed·Graphs<a·class="headerlink"·href="#module-examples.graphs"·title="Link·to·this·heading">¶</a></h3> | 345 | <span·id="directed-graphs"></span><h3>Directed·Graphs<a·class="headerlink"·href="#module-examples.graphs"·title="Link·to·this·heading">¶</a></h3> |
346 | <p>An·example·of·persistence·for·a·directed·graph·structure.···The | 346 | <p>An·example·of·persistence·for·a·directed·graph·structure.···The |
347 | graph·is·stored·as·a·collection·of·edges,·each·referencing·both·a | 347 | graph·is·stored·as·a·collection·of·edges,·each·referencing·both·a |
Offset 378, 31 lines modified | Offset 378, 31 lines modified | ||
378 | subclassing·the·<code·class="docutils·literal·notranslate"><span·class="pre">HasAddresses</span></code>·mixin,·which·ensures·that·the | 378 | subclassing·the·<code·class="docutils·literal·notranslate"><span·class="pre">HasAddresses</span></code>·mixin,·which·ensures·that·the |
379 | parent·class·is·provided·with·an·<code·class="docutils·literal·notranslate"><span·class="pre">addresses</span></code>·collection | 379 | parent·class·is·provided·with·an·<code·class="docutils·literal·notranslate"><span·class="pre">addresses</span></code>·collection |
380 | which·contains·<code·class="docutils·literal·notranslate"><span·class="pre">Address</span></code>·objects.</p> | 380 | which·contains·<code·class="docutils·literal·notranslate"><span·class="pre">Address</span></code>·objects.</p> |
381 | <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 | 381 | <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 |
382 | are·modernized·versions·of·recipes·presented·in·the·2007·blog·post | 382 | are·modernized·versions·of·recipes·presented·in·the·2007·blog·post |
383 | <a·class="reference·external"·href="https://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/">Polymorphic·Associations·with·SQLAlchemy</a>.</p> | 383 | <a·class="reference·external"·href="https://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/">Polymorphic·Associations·with·SQLAlchemy</a>.</p> |
384 | <p>Listing·of·files:<ul·class="simple"> | 384 | <p>Listing·of·files:<ul·class="simple"> |
385 | <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 | ||
386 | objects·within·individual·tables,·each·one·generated·to·persist | ||
387 | those | 385 | <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 |
386 | using·a·single·target·table·and·a·single·association·table, | ||
387 | referred·to·by·all·parent·tables.··The·association·table | ||
388 | contains·a·“discriminator”·column·which·determines·what·type·of | ||
389 | parent·object·associates·to·each·particular·row·in·the·association | ||
390 | table.</p> | ||
388 | </p></li> | 391 | </p></li> |
389 | <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 | 392 | <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 |
390 | to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.··This | 393 | to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.··This |
391 | approach·bypasses·standard·referential·integrity | 394 | approach·bypasses·standard·referential·integrity |
392 | practices,·in·that·the·“foreign·key”·column·is·not·actually | 395 | practices,·in·that·the·“foreign·key”·column·is·not·actually |
393 | constrained·to·refer·to·any·particular·table;·instead, | 396 | constrained·to·refer·to·any·particular·table;·instead, |
394 | in-application·logic·is·used·to·determine·which·table·is·referenced.</p> | 397 | in-application·logic·is·used·to·determine·which·table·is·referenced.</p> |
395 | </p></li> | 398 | </p></li> |
399 | <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 | ||
400 | objects·within·individual·tables,·each·one·generated·to·persist | ||
401 | those·objects·on·behalf·of·a·particular·parent·class.</p> | ||
396 | <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 | ||
397 | using·a·single·target·table·and·a·single·association·table, | ||
398 | referred·to·by·all·parent·tables.··The·association·table | ||
399 | contains·a·“discriminator”·column·which·determines·what·type·of | ||
400 | parent·object·associates·to·each·particular·row·in·the·association | ||
401 | table.</p> | ||
402 | </p></li> | 402 | </p></li> |
403 | <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 | 403 | <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 |
404 | via·a·individually·generated·association·tables·for·each·parent·class. | 404 | via·a·individually·generated·association·tables·for·each·parent·class. |
405 | The·associated·objects·themselves·are·persisted·in·a·single·table | 405 | The·associated·objects·themselves·are·persisted·in·a·single·table |
406 | shared·among·all·parents.</p> | 406 | shared·among·all·parents.</p> |
407 | </p></li> | 407 | </p></li> |
408 | </ul> | 408 | </ul> |
Offset 477, 32 lines modified | Offset 477, 32 lines modified | ||
477 | <div·class="admonition·seealso"> | 477 | <div·class="admonition·seealso"> |
478 | <p·class="admonition-title">See·also</p> | 478 | <p·class="admonition-title">See·also</p> |
479 | <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> | 479 | <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> |
480 | </div> | 480 | </div> |
481 | <section·id="file-listing"> | 481 | <section·id="file-listing"> |
482 | <h4>File·Listing<a·class="headerlink"·href="#file-listing"·title="Link·to·this·heading">¶</a></h4> | 482 | <h4>File·Listing<a·class="headerlink"·href="#file-listing"·title="Link·to·this·heading">¶</a></h4> |
483 | <p>Listing·of·files:<ul·class="simple"> | 483 | <p>Listing·of·files:<ul·class="simple"> |
484 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_updates.html">bulk_updates.py</a>·-·This·series·of·tests·will·illustrate·different·ways·to·UPDATE·a·large·number | ||
485 | of·rows·in·bulk·(under·construction!·there’s·just·one·test·at·the·moment)</p> | ||
486 | </p></li> | ||
487 | <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 | 484 | <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 |
488 | within·a·distinct·transaction,·and·afterwards·returns·to·essentially·a | 485 | within·a·distinct·transaction,·and·afterwards·returns·to·essentially·a |
489 | “closed”·state.···This·would·be·analogous·to·an·API·call·that·starts·up | 486 | “closed”·state.···This·would·be·analogous·to·an·API·call·that·starts·up |
490 | a·database·connection,·inserts·the·row,·commits·and·closes.</p> | 487 | a·database·connection,·inserts·the·row,·commits·and·closes.</p> |
491 | </p></li> | 488 | </p></li> |
489 | <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 | ||
490 | record·by·primary·key</p> | ||
491 | </p></li> | ||
492 | <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 | 492 | <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 |
493 | of·rows·in·bulk.</p> | 493 | of·rows·in·bulk.</p> |
494 | </p></li> | 494 | </p></li> |
495 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/ | 495 | <li><p><p><a·class="reference·external"·href="../_modules/examples/performance/bulk_updates.html">bulk_updates.py</a>·-·This·series·of·tests·will·illustrate·different·ways·to·UPDATE·a·large·number |
496 | of· | 496 | of·rows·in·bulk·(under·construction!·there’s·just·one·test·at·the·moment)</p> |
497 | </p></li> | 497 | </p></li> |
498 | <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> | 498 | <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> |
499 | </p></li> | 499 | </p></li> |
500 | <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 | ||
501 | rec | 500 | <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 |
501 | of·very·small·and·simple·rows.</p> | ||
502 | </p></li> | 502 | </p></li> |
503 | </ul> | 503 | </ul> |
504 | </p> | 504 | </p> |
Max diff block lines reached; 9357/20488 bytes (45.67%) of diff not shown. |
Offset 100, 33 lines modified | Offset 100, 33 lines modified | ||
100 | intermediary·class·mediates·the·relationship·between·two·classes·that·are | 100 | intermediary·class·mediates·the·relationship·between·two·classes·that·are |
101 | associated·in·a·many-to-many·pattern. | 101 | associated·in·a·many-to-many·pattern. |
102 | Listing·of·files: | 102 | Listing·of·files: |
103 | ····*·_\x8d_\x8i_\x8c_\x8t_\x8__\x8o_\x8f_\x8__\x8s_\x8e_\x8t_\x8s_\x8__\x8w_\x8i_\x8t_\x8h_\x8__\x8d_\x8e_\x8f_\x8a_\x8u_\x8l_\x8t_\x8._\x8p_\x8y·-·An·advanced·association·proxy·example | 103 | ····*·_\x8d_\x8i_\x8c_\x8t_\x8__\x8o_\x8f_\x8__\x8s_\x8e_\x8t_\x8s_\x8__\x8w_\x8i_\x8t_\x8h_\x8__\x8d_\x8e_\x8f_\x8a_\x8u_\x8l_\x8t_\x8._\x8p_\x8y·-·An·advanced·association·proxy·example |
104 | ······which·illustrates·nesting·of·association·proxies·to·produce·multi-level | 104 | ······which·illustrates·nesting·of·association·proxies·to·produce·multi-level |
105 | ······Python·collections,·in·this·case·a·dictionary·with·string·keys·and·sets | 105 | ······Python·collections,·in·this·case·a·dictionary·with·string·keys·and·sets |
106 | ······of·integers·as·values,·which·conceal·the·underlying·mapped·classes. | 106 | ······of·integers·as·values,·which·conceal·the·underlying·mapped·classes. |
107 | _\x8p_\x8r_\x8o_\x8x_\x8i_\x8e_\x8d_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Same·example·as·basic_association,·adding·in·usage·of | ||
108 | _\x8s_\x8q_\x8l_\x8a_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y_\x8._\x8e_\x8x_\x8t_\x8._\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8p_\x8r_\x8o_\x8x_\x8y·to·make·explicit·references·to·OrderItem | ||
109 | optional. | ||
110 | _\x8b_\x8a_\x8s_\x8i_\x8c_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Illustrate·a·many-to-many·relationship·between·an | 107 | _\x8b_\x8a_\x8s_\x8i_\x8c_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Illustrate·a·many-to-many·relationship·between·an |
111 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price·with | 108 | “Order”·and·a·collection·of·“Item”·objects,·associating·a·purchase·price·with |
112 | each·via·an·association·object·called·“OrderItem” | 109 | each·via·an·association·object·called·“OrderItem” |
110 | _\x8p_\x8r_\x8o_\x8x_\x8i_\x8e_\x8d_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Same·example·as·basic_association,·adding·in·usage·of | ||
111 | _\x8s_\x8q_\x8l_\x8a_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y_\x8._\x8e_\x8x_\x8t_\x8._\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8p_\x8r_\x8o_\x8x_\x8y·to·make·explicit·references·to·OrderItem | ||
112 | optional. | ||
113 | *\x8**\x8**\x8**\x8*·A\x8As\x8sy\x8yn\x8nc\x8ci\x8io\x8o·I\x8In\x8nt\x8te\x8eg\x8gr\x8ra\x8at\x8ti\x8io\x8on\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8* | 113 | *\x8**\x8**\x8**\x8*·A\x8As\x8sy\x8yn\x8nc\x8ci\x8io\x8o·I\x8In\x8nt\x8te\x8eg\x8gr\x8ra\x8at\x8ti\x8io\x8on\x8n_\x8?\x8¶·*\x8**\x8**\x8**\x8* |
114 | Examples·illustrating·the·asyncio·engine·feature·of·SQLAlchemy. | 114 | Examples·illustrating·the·asyncio·engine·feature·of·SQLAlchemy. |
115 | Listing·of·files: | 115 | Listing·of·files: |
116 | ····*·_\x8g_\x8a_\x8t_\x8h_\x8e_\x8r_\x8__\x8o_\x8r_\x8m_\x8__\x8s_\x8t_\x8a_\x8t_\x8e_\x8m_\x8e_\x8n_\x8t_\x8s_\x8._\x8p_\x8y·-·Illustrates·how·to·run·many·statements | ||
117 | ······concurrently·using·asyncio.gather()·along·many·asyncio·database | ||
118 | ······connections,·merging·ORM·results·into·a·single·AsyncSession. | ||
119 | _\x8a_\x8s_\x8y_\x8n_\x8c_\x8__\x8o_\x8r_\x8m_\x8._\x8p_\x8y·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession | 116 | ····*·_\x8a_\x8s_\x8y_\x8n_\x8c_\x8__\x8o_\x8r_\x8m_\x8._\x8p_\x8y·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession |
120 | object·for·asynchronous·ORM·use. | 117 | ······object·for·asynchronous·ORM·use. |
118 | _\x8g_\x8r_\x8e_\x8e_\x8n_\x8l_\x8e_\x8t_\x8__\x8o_\x8r_\x8m_\x8._\x8p_\x8y·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession | ||
119 | object·for·asynchronous·ORM·use,·including·the·optional·run_sync()·method. | ||
120 | _\x8g_\x8a_\x8t_\x8h_\x8e_\x8r_\x8__\x8o_\x8r_\x8m_\x8__\x8s_\x8t_\x8a_\x8t_\x8e_\x8m_\x8e_\x8n_\x8t_\x8s_\x8._\x8p_\x8y·-·Illustrates·how·to·run·many·statements·concurrently | ||
121 | using·asyncio.gather()·along·many·asyncio·database·connections,·merging·ORM | ||
122 | results·into·a·single·AsyncSession. | ||
121 | _\x8a_\x8s_\x8y_\x8n_\x8c_\x8__\x8o_\x8r_\x8m_\x8__\x8w_\x8r_\x8i_\x8t_\x8e_\x8o_\x8n_\x8l_\x8y_\x8._\x8p_\x8y·-·Illustrates·using·w\x8wr\x8ri\x8it\x8te\x8e·o\x8on\x8nl\x8ly\x8y·r\x8re\x8el\x8la\x8at\x8ti\x8io\x8on\x8ns\x8sh\x8hi\x8ip\x8ps\x8s·for·simpler | 123 | _\x8a_\x8s_\x8y_\x8n_\x8c_\x8__\x8o_\x8r_\x8m_\x8__\x8w_\x8r_\x8i_\x8t_\x8e_\x8o_\x8n_\x8l_\x8y_\x8._\x8p_\x8y·-·Illustrates·using·w\x8wr\x8ri\x8it\x8te\x8e·o\x8on\x8nl\x8ly\x8y·r\x8re\x8el\x8la\x8at\x8ti\x8io\x8on\x8ns\x8sh\x8hi\x8ip\x8ps\x8s·for·simpler |
122 | handling·of·ORM·collections·under·asyncio. | 124 | handling·of·ORM·collections·under·asyncio. |
123 | _\x8b_\x8a_\x8s_\x8i_\x8c_\x8._\x8p_\x8y·-·Illustrates·the·asyncio·engine·/·connection·interface. | 125 | _\x8b_\x8a_\x8s_\x8i_\x8c_\x8._\x8p_\x8y·-·Illustrates·the·asyncio·engine·/·connection·interface. |
124 | _\x8g_\x8r_\x8e_\x8e_\x8n_\x8l_\x8e_\x8t_\x8__\x8o_\x8r_\x8m_\x8._\x8p_\x8y·-·Illustrates·use·of·the·sqlalchemy.ext.asyncio.AsyncSession | ||
125 | object·for·asynchronous·ORM·use,·including·the·optional·run_sync()·method. | ||
126 | *\x8**\x8**\x8**\x8*·D\x8Di\x8ir\x8re\x8ec\x8ct\x8te\x8ed\x8d·G\x8Gr\x8ra\x8ap\x8ph\x8hs\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* | 126 | *\x8**\x8**\x8**\x8*·D\x8Di\x8ir\x8re\x8ec\x8ct\x8te\x8ed\x8d·G\x8Gr\x8ra\x8ap\x8ph\x8hs\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* |
127 | An·example·of·persistence·for·a·directed·graph·structure.·The·graph·is·stored | 127 | An·example·of·persistence·for·a·directed·graph·structure.·The·graph·is·stored |
128 | as·a·collection·of·edges,·each·referencing·both·a·“lower”·and·an·“upper”·node | 128 | as·a·collection·of·edges,·each·referencing·both·a·“lower”·and·an·“upper”·node |
129 | in·a·table·of·nodes.·Basic·persistence·and·querying·for·lower-·and·upper- | 129 | in·a·table·of·nodes.·Basic·persistence·and·querying·for·lower-·and·upper- |
130 | neighbors·are·illustrated: | 130 | neighbors·are·illustrated: |
131 | n2·=·Node(2) | 131 | n2·=·Node(2) |
132 | n5·=·Node(5) | 132 | n5·=·Node(5) |
Offset 148, 27 lines modified | Offset 148, 27 lines modified | ||
148 | Supplier,·both·subclassing·the·HasAddresses·mixin,·which·ensures·that·the | 148 | Supplier,·both·subclassing·the·HasAddresses·mixin,·which·ensures·that·the |
149 | parent·class·is·provided·with·an·addresses·collection·which·contains·Address | 149 | parent·class·is·provided·with·an·addresses·collection·which·contains·Address |
150 | objects. | 150 | objects. |
151 | The·_\x8d_\x8i_\x8s_\x8c_\x8r_\x8i_\x8m_\x8i_\x8n_\x8a_\x8t_\x8o_\x8r_\x8__\x8o_\x8n_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·and·_\x8g_\x8e_\x8n_\x8e_\x8r_\x8i_\x8c_\x8__\x8f_\x8k_\x8._\x8p_\x8y·scripts·are·modernized | 151 | The·_\x8d_\x8i_\x8s_\x8c_\x8r_\x8i_\x8m_\x8i_\x8n_\x8a_\x8t_\x8o_\x8r_\x8__\x8o_\x8n_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·and·_\x8g_\x8e_\x8n_\x8e_\x8r_\x8i_\x8c_\x8__\x8f_\x8k_\x8._\x8p_\x8y·scripts·are·modernized |
152 | versions·of·recipes·presented·in·the·2007·blog·post·_\x8P_\x8o_\x8l_\x8y_\x8m_\x8o_\x8r_\x8p_\x8h_\x8i_\x8c_\x8·_\x8A_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8s | 152 | versions·of·recipes·presented·in·the·2007·blog·post·_\x8P_\x8o_\x8l_\x8y_\x8m_\x8o_\x8r_\x8p_\x8h_\x8i_\x8c_\x8·_\x8A_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8s |
153 | _\x8w_\x8i_\x8t_\x8h_\x8·_\x8S_\x8Q_\x8L_\x8A_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y. | 153 | _\x8w_\x8i_\x8t_\x8h_\x8·_\x8S_\x8Q_\x8L_\x8A_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y. |
154 | Listing·of·files: | 154 | Listing·of·files: |
155 | ····*·_\x8t_\x8a_\x8b_\x8l_\x8e_\x8__\x8p_\x8e_\x8r_\x8__\x8r_\x8e_\x8l_\x8a_\x8t_\x8e_\x8d_\x8._\x8p_\x8y·-·Illustrates·a·generic·association·which·persists | ||
156 | ······association·objects·within·individual·tables,·each·one·generated·to | ||
157 | ····· | 155 | ····*·_.d_.i_.s_.c_.r_.i_.m_.i_.n_.a_.t_.o_.r_.__.o_.n_.__.a_.s_.s_.o_.c_.i_.a_.t_.i_.o_.n_.._.p_.y·-·Illustrates·a·mixin·which·provides·a |
156 | ······generic·association·using·a·single·target·table·and·a·single·association | ||
157 | ······table,·referred·to·by·all·parent·tables.·The·association·table·contains·a | ||
158 | ······“discriminator”·column·which·determines·what·type·of·parent·object | ||
159 | ······associates·to·each·particular·row·in·the·association·table. | ||
158 | _\x8g_\x8e_\x8n_\x8e_\x8r_\x8i_\x8c_\x8__\x8f_\x8k_\x8._\x8p_\x8y·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar | 160 | _\x8g_\x8e_\x8n_\x8e_\x8r_\x8i_\x8c_\x8__\x8f_\x8k_\x8._\x8p_\x8y·-·Illustrates·a·so-called·“generic·foreign·key”,·in·a·similar |
159 | fashion·to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.·This·approach | 161 | fashion·to·that·of·popular·frameworks·such·as·Django,·ROR,·etc.·This·approach |
160 | bypasses·standard·referential·integrity·practices,·in·that·the·“foreign·key” | 162 | bypasses·standard·referential·integrity·practices,·in·that·the·“foreign·key” |
161 | column·is·not·actually·constrained·to·refer·to·any·particular·table;·instead, | 163 | column·is·not·actually·constrained·to·refer·to·any·particular·table;·instead, |
162 | in-application·logic·is·used·to·determine·which·table·is·referenced. | 164 | in-application·logic·is·used·to·determine·which·table·is·referenced. |
165 | _\x8t_\x8a_\x8b_\x8l_\x8e_\x8__\x8p_\x8e_\x8r_\x8__\x8r_\x8e_\x8l_\x8a_\x8t_\x8e_\x8d_\x8._\x8p_\x8y·-·Illustrates·a·generic·association·which·persists | ||
166 | association·objects·within·individual·tables,·each·one·generated·to·persist | ||
167 | those·objects·on·behalf·of·a·particular·parent·class. | ||
163 | _\x8d_\x8i_\x8s_\x8c_\x8r_\x8i_\x8m_\x8i_\x8n_\x8a_\x8t_\x8o_\x8r_\x8__\x8o_\x8n_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Illustrates·a·mixin·which·provides·a·generic | ||
164 | association·using·a·single·target·table·and·a·single·association·table, | ||
165 | referred·to·by·all·parent·tables.·The·association·table·contains·a | ||
166 | “discriminator”·column·which·determines·what·type·of·parent·object·associates | ||
167 | to·each·particular·row·in·the·association·table. | ||
168 | _\x8t_\x8a_\x8b_\x8l_\x8e_\x8__\x8p_\x8e_\x8r_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Illustrates·a·mixin·which·provides·a·generic | 168 | _\x8t_\x8a_\x8b_\x8l_\x8e_\x8__\x8p_\x8e_\x8r_\x8__\x8a_\x8s_\x8s_\x8o_\x8c_\x8i_\x8a_\x8t_\x8i_\x8o_\x8n_\x8._\x8p_\x8y·-·Illustrates·a·mixin·which·provides·a·generic |
169 | association·via·a·individually·generated·association·tables·for·each·parent | 169 | association·via·a·individually·generated·association·tables·for·each·parent |
170 | class.·The·associated·objects·themselves·are·persisted·in·a·single·table·shared | 170 | class.·The·associated·objects·themselves·are·persisted·in·a·single·table·shared |
171 | among·all·parents. | 171 | among·all·parents. |
172 | *\x8**\x8**\x8**\x8*·M\x8Ma\x8at\x8te\x8er\x8ri\x8ia\x8al\x8li\x8iz\x8ze\x8ed\x8d·P\x8Pa\x8at\x8th\x8hs\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* | 172 | *\x8**\x8**\x8**\x8*·M\x8Ma\x8at\x8te\x8er\x8ri\x8ia\x8al\x8li\x8iz\x8ze\x8ed\x8d·P\x8Pa\x8at\x8th\x8hs\x8s_\x8?\x8¶·*\x8**\x8**\x8**\x8* |
173 | Illustrates·the·“materialized·paths”·pattern·for·hierarchical·data·using·the | 173 | Illustrates·the·“materialized·paths”·pattern·for·hierarchical·data·using·the |
174 | SQLAlchemy·ORM. | 174 | SQLAlchemy·ORM. |
Offset 220, 28 lines modified | Offset 220, 29 lines modified | ||
220 | $·python·-m·examples.performance·bulk_inserts·\ | 220 | $·python·-m·examples.performance·bulk_inserts·\ |
221 | ····--dburl·mysql+mysqldb://scott:tiger@localhost/test·\ | 221 | ····--dburl·mysql+mysqldb://scott:tiger@localhost/test·\ |
222 | ····--profile·--num·1000 | 222 | ····--profile·--num·1000 |
223 | See·also | 223 | See·also |
224 | _\x8H_\x8o_\x8w_\x8·_\x8c_\x8a_\x8n_\x8·_\x8I_\x8·_\x8p_\x8r_\x8o_\x8f_\x8i_\x8l_\x8e_\x8·_\x8a_\x8·_\x8S_\x8Q_\x8L_\x8A_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y_\x8·_\x8p_\x8o_\x8w_\x8e_\x8r_\x8e_\x8d_\x8·_\x8a_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n_\x8? | 224 | _\x8H_\x8o_\x8w_\x8·_\x8c_\x8a_\x8n_\x8·_\x8I_\x8·_\x8p_\x8r_\x8o_\x8f_\x8i_\x8l_\x8e_\x8·_\x8a_\x8·_\x8S_\x8Q_\x8L_\x8A_\x8l_\x8c_\x8h_\x8e_\x8m_\x8y_\x8·_\x8p_\x8o_\x8w_\x8e_\x8r_\x8e_\x8d_\x8·_\x8a_\x8p_\x8p_\x8l_\x8i_\x8c_\x8a_\x8t_\x8i_\x8o_\x8n_\x8? |
225 | *\x8**\x8**\x8*·F\x8Fi\x8il\x8le\x8e·L\x8Li\x8is\x8st\x8ti\x8in\x8ng\x8g_\x8?\x8¶·*\x8**\x8**\x8* | 225 | *\x8**\x8**\x8*·F\x8Fi\x8il\x8le\x8e·L\x8Li\x8is\x8st\x8ti\x8in\x8ng\x8g_\x8?\x8¶·*\x8**\x8**\x8* |
226 | Listing·of·files: | 226 | Listing·of·files: |
227 | ····*·_\x8b_\x8u_\x8l_\x8k_\x8__\x8u_\x8p_\x8d_\x8a_\x8t_\x8e_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·will·illustrate·different·ways·to | ||
228 | ······UPDATE·a·large·number·of·rows·in·bulk·(under·construction!·there’s·just | ||
229 | ······one·test·at·the·moment) | ||
230 | _.s_.i_.n_.g_.l_.e_.__.i_.n_.s_.e_.r_.t_.s_.._.p_.y·-·In·this·series·of·tests,·we’re·looking·at·a·method | 227 | ····*·_.s_.i_.n_.g_.l_.e_.__.i_.n_.s_.e_.r_.t_.s_.._.p_.y·-·In·this·series·of·tests,·we’re·looking·at·a·method |
231 | inserts·a·row·within·a·distinct·transaction,·and·afterwards·returns | 228 | ······that·inserts·a·row·within·a·distinct·transaction,·and·afterwards·returns |
232 | essentially·a·“closed”·state.·This·would·be·analogous·to·an·API·call | 229 | ······to·essentially·a·“closed”·state.·This·would·be·analogous·to·an·API·call |
233 | starts·up·a·database·connection,·inserts·the·row,·commits·and | 230 | ······that·starts·up·a·database·connection,·inserts·the·row,·commits·and |
231 | ······closes. | ||
232 | _\x8s_\x8h_\x8o_\x8r_\x8t_\x8__\x8s_\x8e_\x8l_\x8e_\x8c_\x8t_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a | ||
233 | single·record·by·primary·key | ||
234 | _\x8b_\x8u_\x8l_\x8k_\x8__\x8i_\x8n_\x8s_\x8e_\x8r_\x8t_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a | 234 | _\x8b_\x8u_\x8l_\x8k_\x8__\x8i_\x8n_\x8s_\x8e_\x8r_\x8t_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·illustrates·different·ways·to·INSERT·a |
235 | large·number·of·rows·in·bulk. | 235 | large·number·of·rows·in·bulk. |
236 | _\x8b_\x8u_\x8l_\x8k_\x8__\x8u_\x8p_\x8d_\x8a_\x8t_\x8e_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·will·illustrate·different·ways·to·UPDATE | ||
237 | a·large·number·of·rows·in·bulk·(under·construction!·there’s·just·one·test·at | ||
238 | the·moment) | ||
239 | _\x8__\x8__\x8m_\x8a_\x8i_\x8n_\x8__\x8__\x8._\x8p_\x8y·-·Allows·the·examples/performance·package·to·be·run·as·a·script. | ||
236 | _\x8l_\x8a_\x8r_\x8g_\x8e_\x8__\x8r_\x8e_\x8s_\x8u_\x8l_\x8t_\x8s_\x8e_\x8t_\x8s_\x8._\x8p_\x8y·-·In·this·series·of·tests,·we·are·looking·at·time·to·load·a | 240 | _\x8l_\x8a_\x8r_\x8g_\x8e_\x8__\x8r_\x8e_\x8s_\x8u_\x8l_\x8t_\x8s_\x8e_\x8t_\x8s_\x8._\x8p_\x8y·-·In·this·series·of·tests,·we·are·looking·at·time·to·load·a |
237 | large·number·of·very·small·and·simple·rows. | 241 | large·number·of·very·small·and·simple·rows. |
238 | _\x8__\x8__\x8m_\x8a_\x8i_\x8n_\x8__\x8__\x8._\x8p_\x8y·-·Allows·the·examples/performance·package·to·be·run·as·a·script. | ||
239 | _\x8s_\x8h_\x8o_\x8r_\x8t_\x8__\x8s_\x8e_\x8l_\x8e_\x8c_\x8t_\x8s_\x8._\x8p_\x8y·-·This·series·of·tests·illustrates·different·ways·to·SELECT·a | ||
240 | single·record·by·primary·key | ||
241 | *\x8**\x8**\x8*·R\x8Ru\x8un\x8nn\x8ni\x8in\x8ng\x8g·a\x8al\x8ll\x8l·t\x8te\x8es\x8st\x8ts\x8s·w\x8wi\x8it\x8th\x8h·t\x8ti\x8im\x8me\x8e_\x8?\x8¶·*\x8**\x8**\x8* | 242 | *\x8**\x8**\x8*·R\x8Ru\x8un\x8nn\x8ni\x8in\x8ng\x8g·a\x8al\x8ll\x8l·t\x8te\x8es\x8st\x8ts\x8s·w\x8wi\x8it\x8th\x8h·t\x8ti\x8im\x8me\x8e_\x8?\x8¶·*\x8**\x8**\x8* |
242 | This·is·the·default·form·of·run: | 243 | This·is·the·default·form·of·run: |
243 | $·python·-m·examples.performance·single_inserts | 244 | $·python·-m·examples.performance·single_inserts |
244 | Tests·to·run:·test_orm_commit,·test_bulk_save, | 245 | Tests·to·run:·test_orm_commit,·test_bulk_save, |
245 | ··············test_bulk_insert_dictionaries,·test_core, | 246 | ··············test_bulk_insert_dictionaries,·test_core, |
246 | ··············test_core_query_caching,·test_dbapi_raw_w_connect, | 247 | ··············test_core_query_caching,·test_dbapi_raw_w_connect, |
247 | ··············test_dbapi_raw_w_pool | 248 | ··············test_dbapi_raw_w_pool |
Offset 472, 27 lines modified | Offset 473, 27 lines modified | ||
472 | Several·examples·that·illustrate·the·technique·of·intercepting·changes·that | 473 | Several·examples·that·illustrate·the·technique·of·intercepting·changes·that |
473 | would·be·first·interpreted·as·an·UPDATE·on·a·row,·and·instead·turning·it·into | 474 | would·be·first·interpreted·as·an·UPDATE·on·a·row,·and·instead·turning·it·into |
474 | an·INSERT·of·a·new·row,·leaving·the·previous·row·intact·as·a·historical | 475 | an·INSERT·of·a·new·row,·leaving·the·previous·row·intact·as·a·historical |
475 | version. | 476 | version. |
476 | Compare·to·the·_\x8V_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8i_\x8n_\x8g_\x8·_\x8w_\x8i_\x8t_\x8h_\x8·_\x8a_\x8·_\x8H_\x8i_\x8s_\x8t_\x8o_\x8r_\x8y_\x8·_\x8T_\x8a_\x8b_\x8l_\x8e·example·which·writes·a·history | 477 | Compare·to·the·_\x8V_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8i_\x8n_\x8g_\x8·_\x8w_\x8i_\x8t_\x8h_\x8·_\x8a_\x8·_\x8H_\x8i_\x8s_\x8t_\x8o_\x8r_\x8y_\x8·_\x8T_\x8a_\x8b_\x8l_\x8e·example·which·writes·a·history |
477 | row·to·a·separate·history·table. | 478 | row·to·a·separate·history·table. |
478 | Listing·of·files: | 479 | Listing·of·files: |
479 | ····*·_\x8v_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8e_\x8d_\x8__\x8m_\x8a_\x8p_\x8._\x8p_\x8y·-·A·variant·of·the·versioned_rows·example·built·around | ||
480 | ······the·concept·of·a·“vertical·table”·structure,·like·those·illustrated·in | ||
481 | ······_\x8V_\x8e_\x8r_\x8t_\x8i_\x8c_\x8a_\x8l_\x8·_\x8A_\x8t_\x8t_\x8r_\x8i_\x8b_\x8u_\x8t_\x8e_\x8·_\x8M_\x8a_\x8p_\x8p_\x8i_\x8n_\x8g·examples. | ||
482 | _\x8v_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8e_\x8d_\x8__\x8r_\x8o_\x8w_\x8s_\x8._\x8p_\x8y·-·Illustrates·a·method·to·intercept·changes·on·objects, | 480 | ····*·_\x8v_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8e_\x8d_\x8__\x8r_\x8o_\x8w_\x8s_\x8._\x8p_\x8y·-·Illustrates·a·method·to·intercept·changes·on·objects, |
483 | turning·an·UPDATE·statement·on·a·single·row·into·an·INSERT·statement,·so | 481 | ······turning·an·UPDATE·statement·on·a·single·row·into·an·INSERT·statement,·so |
484 | new·row·is·inserted·with·the·new·data,·keeping·the·old·row·intact. | ||
485 | _\x8v_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8e_\x8d_\x8__\x8r_\x8o_\x8w_\x8s_\x8__\x8w_\x8__\x8v_\x8e_\x8r_\x8s_\x8i_\x8o_\x8n_\x8i_\x8d_\x8._\x8p_\x8y·-·Illustrates·a·method·to·intercept·changes·on | ||
Max diff block lines reached; 6145/16619 bytes (36.98%) of diff not shown. |