--- /srv/reproducible-results/rbuild-debian/r-b-build.12amzAP4/b1/sqlalchemy_1.4.46+ds1-1_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.12amzAP4/b2/sqlalchemy_1.4.46+ds1-1_armhf.changes ├── Files │ @@ -1,5 +1,5 @@ │ │ - 738bcf9ea3bfc374783efac2af3616f6 3566904 doc optional python-sqlalchemy-doc_1.4.46+ds1-1_all.deb │ + 634380def68a5bbb66a0891f7ede3d69 3566912 doc optional python-sqlalchemy-doc_1.4.46+ds1-1_all.deb │ 3c192543be22fb57144d84a272c81948 38500 debug optional python3-sqlalchemy-ext-dbgsym_1.4.46+ds1-1_armhf.deb │ 5ccd5b6dab9317a63c8dfe1f1e5fee5f 14768 python optional python3-sqlalchemy-ext_1.4.46+ds1-1_armhf.deb │ 96e279ec2f1354d84035113d9bc40d65 1007608 python optional python3-sqlalchemy_1.4.46+ds1-1_all.deb ├── python-sqlalchemy-doc_1.4.46+ds1-1_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-09 15:19:05.000000 debian-binary │ │ -rw-r--r-- 0 0 0 13272 2023-01-09 15:19:05.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 3553440 2023-01-09 15:19:05.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 3553448 2023-01-09 15:19:05.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── ./usr/share/doc/python-sqlalchemy-doc/html/changelog/changelog_14.html │ │ │ │ @@ -8692,15 +8692,22 @@ │ │ │ │
│ │ │ │

See also

│ │ │ │

RowProxy is no longer a “proxy”; is now called Row and behaves like an enhanced named tuple

│ │ │ │
│ │ │ │

References: #4710

│ │ │ │

│ │ │ │ │ │ │ │ -
  • [engine] [change] [performance] [py3k]

    Disabled the “unicode returns” check that runs on dialect startup when │ │ │ │ +

  • [engine] [performance]

    The pool “pre-ping” feature has been refined to not invoke for a DBAPI │ │ │ │ +connection that was just opened in the same checkout operation. pre ping │ │ │ │ +only applies to a DBAPI connection that’s been checked into the pool │ │ │ │ +and is being checked out again.

    │ │ │ │ +

    References: #4524

    │ │ │ │ +

    │ │ │ │ +
  • │ │ │ │ +
  • [engine] [performance] [change] [py3k]

    Disabled the “unicode returns” check that runs on dialect startup when │ │ │ │ running under Python 3, which for many years has occurred in order to test │ │ │ │ the current DBAPI’s behavior for whether or not it returns Python Unicode │ │ │ │ or Py2K strings for the VARCHAR and NVARCHAR datatypes. The check still │ │ │ │ occurs by default under Python 2, however the mechanism to test the │ │ │ │ behavior will be removed in SQLAlchemy 2.0 when Python 2 support is also │ │ │ │ removed.

    │ │ │ │

    This logic was very effective when it was needed, however now that Python 3 │ │ │ │ @@ -8711,21 +8718,14 @@ │ │ │ │ dialect flags by setting the dialect level flag returns_unicode_strings │ │ │ │ to one of String.RETURNS_CONDITIONAL or │ │ │ │ String.RETURNS_BYTES, both of which will enable Unicode conversion │ │ │ │ even under Python 3.

    │ │ │ │

    References: #5315

    │ │ │ │

    │ │ │ │
  • │ │ │ │ -
  • [engine] [performance]

    The pool “pre-ping” feature has been refined to not invoke for a DBAPI │ │ │ │ -connection that was just opened in the same checkout operation. pre ping │ │ │ │ -only applies to a DBAPI connection that’s been checked into the pool │ │ │ │ -and is being checked out again.

    │ │ │ │ -

    References: #4524

    │ │ │ │ -

    │ │ │ │ -
  • │ │ │ │
  • [engine] [bug]

    Revised the Connection.execution_options.schema_translate_map │ │ │ │ feature such that the processing of the SQL statement to receive a specific │ │ │ │ schema name occurs within the execution phase of the statement, rather than │ │ │ │ at the compile phase. This is to support the statement being efficiently │ │ │ │ cached. Previously, the current schema being rendered into the statement │ │ │ │ for a particular run would be considered as part of the cache key itself, │ │ │ │ meaning that for a run against hundreds of schemas, there would be hundreds │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6298,15 +6298,21 @@ │ │ │ │ │ returned by the ResultProxy is now the LegacyRow subclass, which maintains │ │ │ │ │ mapping/tuple hybrid behavior, however the base Row class now behaves more │ │ │ │ │ fully like a named tuple. │ │ │ │ │ See also │ │ │ │ │ RowProxy_is_no_longer_a_“proxy”;_is_now_called_Row_and_behaves_like_an_enhanced │ │ │ │ │ named_tuple │ │ │ │ │ References: #4710 │ │ │ │ │ -[engine] [change] [performance] [py3k] ¶ │ │ │ │ │ +[engine] [performance] ¶ │ │ │ │ │ +The pool “pre-ping” feature has been refined to not invoke for a DBAPI │ │ │ │ │ +connection that was just opened in the same checkout operation. pre ping only │ │ │ │ │ +applies to a DBAPI connection that’s been checked into the pool and is being │ │ │ │ │ +checked out again. │ │ │ │ │ +References: #4524 │ │ │ │ │ +[engine] [performance] [change] [py3k] ¶ │ │ │ │ │ Disabled the “unicode returns” check that runs on dialect startup when running │ │ │ │ │ under Python 3, which for many years has occurred in order to test the current │ │ │ │ │ DBAPI’s behavior for whether or not it returns Python Unicode or Py2K strings │ │ │ │ │ for the VARCHAR and NVARCHAR datatypes. The check still occurs by default under │ │ │ │ │ Python 2, however the mechanism to test the behavior will be removed in │ │ │ │ │ SQLAlchemy 2.0 when Python 2 support is also removed. │ │ │ │ │ This logic was very effective when it was needed, however now that Python 3 is │ │ │ │ │ @@ -6314,20 +6320,14 @@ │ │ │ │ │ datatypes. In the unlikely case that a third party DBAPI does not support this, │ │ │ │ │ the conversion logic within String is still available and the third party │ │ │ │ │ dialect may specify this in its upfront dialect flags by setting the dialect │ │ │ │ │ level flag returns_unicode_strings to one of String.RETURNS_CONDITIONAL or │ │ │ │ │ String.RETURNS_BYTES, both of which will enable Unicode conversion even under │ │ │ │ │ Python 3. │ │ │ │ │ References: #5315 │ │ │ │ │ -[engine] [performance] ¶ │ │ │ │ │ -The pool “pre-ping” feature has been refined to not invoke for a DBAPI │ │ │ │ │ -connection that was just opened in the same checkout operation. pre ping only │ │ │ │ │ -applies to a DBAPI connection that’s been checked into the pool and is being │ │ │ │ │ -checked out again. │ │ │ │ │ -References: #4524 │ │ │ │ │ [engine] [bug] ¶ │ │ │ │ │ Revised the Connection.execution_options.schema_translate_map feature such that │ │ │ │ │ the processing of the SQL statement to receive a specific schema name occurs │ │ │ │ │ within the execution phase of the statement, rather than at the compile phase. │ │ │ │ │ This is to support the statement being efficiently cached. Previously, the │ │ │ │ │ current schema being rendered into the statement for a particular run would be │ │ │ │ │ considered as part of the cache key itself, meaning that for a run against │ │ │ ├── ./usr/share/doc/python-sqlalchemy-doc/html/orm/examples.html │ │ │ │┄ Ordering differences only │ │ │ │ @@ -313,38 +313,38 @@ │ │ │ │ where an intermediary class mediates the relationship between two │ │ │ │ classes that are associated in a many-to-many pattern.

    │ │ │ │

    Listing of files:

    │ │ │ │

    │ │ │ │ │ │ │ │
    │ │ │ │

    Asyncio Integration

    │ │ │ │

    Examples illustrating the asyncio engine feature of SQLAlchemy.

    │ │ │ │

    Listing of files:

    │ │ │ │

    │ │ │ │
    │ │ │ │ @@ -385,37 +385,37 @@ │ │ │ │ subclassing the HasAddresses mixin, which ensures that the │ │ │ │ parent class is provided with an addresses collection │ │ │ │ which contains Address objects.

    │ │ │ │

    The discriminator_on_association.py and generic_fk.py scripts │ │ │ │ are modernized versions of recipes presented in the 2007 blog post │ │ │ │ Polymorphic Associations with SQLAlchemy.

    │ │ │ │

    Listing of files:

    │ │ │ │

    │ │ │ │ │ │ │ │
    │ │ │ │

    Large Collections

    │ │ │ │

    Large collection example.

    │ │ │ │

    Illustrates the options to use with │ │ │ │ @@ -501,33 +501,33 @@ │ │ │ │

    │ │ │ │

    See also

    │ │ │ │

    How can I profile a SQLAlchemy powered application?

    │ │ │ │
    │ │ │ │
    │ │ │ │

    File Listing

    │ │ │ │

    Listing of files:

      │ │ │ │ +
    • single_inserts.py - In this series of tests, we’re looking at a method that inserts a row │ │ │ │ +within a distinct transaction, and afterwards returns to essentially a │ │ │ │ +“closed” state. This would be analogous to an API call that starts up │ │ │ │ +a database connection, inserts the row, commits and closes.

      │ │ │ │ +

    • │ │ │ │
    • short_selects.py - This series of tests illustrates different ways to SELECT a single │ │ │ │ record by primary key

      │ │ │ │

    • │ │ │ │ -
    • __main__.py - Allows the examples/performance package to be run as a script.

      │ │ │ │ +
    • bulk_updates.py - This series of tests will illustrate different ways to UPDATE a large number │ │ │ │ +of rows in bulk (under construction! there’s just one test at the moment)

      │ │ │ │

    • │ │ │ │
    • large_resultsets.py - In this series of tests, we are looking at time to load a large number │ │ │ │ of very small and simple rows.

      │ │ │ │

    • │ │ │ │ -
    • single_inserts.py - In this series of tests, we’re looking at a method that inserts a row │ │ │ │ -within a distinct transaction, and afterwards returns to essentially a │ │ │ │ -“closed” state. This would be analogous to an API call that starts up │ │ │ │ -a database connection, inserts the row, commits and closes.

      │ │ │ │ +
    • __main__.py - Allows the examples/performance package to be run as a script.

      │ │ │ │

    • │ │ │ │
    • bulk_inserts.py - This series of tests illustrates different ways to INSERT a large number │ │ │ │ of rows in bulk.

      │ │ │ │

    • │ │ │ │ -
    • bulk_updates.py - This series of tests will illustrate different ways to UPDATE a large number │ │ │ │ -of rows in bulk (under construction! there’s just one test at the moment)

      │ │ │ │ -

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Running all tests with time

    │ │ │ │

    This is the default form of run:

    │ │ │ │
    $ python -m examples.performance single_inserts
    │ │ │ │ @@ -669,22 +669,22 @@
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    Relationship Join Conditions

    │ │ │ │

    Examples of various relationship() configurations, │ │ │ │ which make use of the primaryjoin argument to compose special types │ │ │ │ of join conditions.

    │ │ │ │

    Listing of files:

      │ │ │ │ -
    • cast.py - Illustrate a relationship() that joins two columns where those │ │ │ │ -columns are not of the same type, and a CAST must be used on the SQL │ │ │ │ -side in order to match them.

      │ │ │ │ -

    • │ │ │ │
    • threeway.py - Illustrate a “three way join” - where a primary table joins to a remote │ │ │ │ table via an association table, but then the primary table also needs │ │ │ │ to refer to some columns in the remote table directly.

      │ │ │ │

    • │ │ │ │ +
    • cast.py - Illustrate a relationship() that joins two columns where those │ │ │ │ +columns are not of the same type, and a CAST must be used on the SQL │ │ │ │ +side in order to match them.

      │ │ │ │ +

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Space Invaders

    │ │ │ │

    A Space Invaders game using SQLite as the state machine.

    │ │ │ │

    Originally developed in 2012. Adapted to work in Python 3.

    │ │ │ │ @@ -814,47 +814,47 @@ │ │ │ │ assert type(other) is SomeClass and other.id == self.id │ │ │ │ │ │ │ │

    Above, if two instance of SomeClass with the same version identifier │ │ │ │ are updated and sent to the database for UPDATE concurrently, if the database │ │ │ │ isolation level allows the two UPDATE statements to proceed, one will fail │ │ │ │ because it no longer is against the last known version identifier.

    │ │ │ │

    Listing of files:

      │ │ │ │ -
    • history_meta.py - Versioned mixin class and other utilities.

      │ │ │ │ -

    • │ │ │ │
    • test_versioning.py - Unit tests illustrating usage of the history_meta.py │ │ │ │ module functions.

      │ │ │ │

    • │ │ │ │ +
    • history_meta.py - Versioned mixin class and other utilities.

      │ │ │ │ +

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Versioning using Temporal Rows

    │ │ │ │

    Several examples that illustrate the technique of intercepting changes │ │ │ │ that would be first interpreted as an UPDATE on a row, and instead turning │ │ │ │ it into an INSERT of a new row, leaving the previous row intact as │ │ │ │ a historical version.

    │ │ │ │

    Compare to the Versioning with a History Table example which writes a │ │ │ │ history row to a separate history table.

    │ │ │ │

    Listing of files:

      │ │ │ │ -
    • versioned_rows_w_versionid.py - Illustrates a method to intercept changes on objects, turning │ │ │ │ -an UPDATE statement on a single row into an INSERT statement, so that a new │ │ │ │ -row is inserted with the new data, keeping the old row intact.

      │ │ │ │ -

    • │ │ │ │
    • versioned_update_old_row.py - Illustrates the same UPDATE into INSERT technique of versioned_rows.py, │ │ │ │ but also emits an UPDATE on the old row to affect a change in timestamp. │ │ │ │ Also includes a SessionEvents.do_orm_execute() hook to limit queries │ │ │ │ to only the most recent version.

      │ │ │ │

    • │ │ │ │ +
    • versioned_map.py - A variant of the versioned_rows example built around the │ │ │ │ +concept of a “vertical table” structure, like those illustrated in │ │ │ │ +Vertical Attribute Mapping examples.

      │ │ │ │ +

    • │ │ │ │
    • versioned_rows.py - Illustrates a method to intercept changes on objects, turning │ │ │ │ an UPDATE statement on a single row into an INSERT statement, so that a new │ │ │ │ row is inserted with the new data, keeping the old row intact.

      │ │ │ │

    • │ │ │ │ -
    • versioned_map.py - A variant of the versioned_rows example built around the │ │ │ │ -concept of a “vertical table” structure, like those illustrated in │ │ │ │ -Vertical Attribute Mapping examples.

      │ │ │ │ +
    • versioned_rows_w_versionid.py - Illustrates a method to intercept changes on objects, turning │ │ │ │ +an UPDATE statement on a single row into an INSERT statement, so that a new │ │ │ │ +row is inserted with the new data, keeping the old row intact.

      │ │ │ │

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Vertical Attribute Mapping

    │ │ │ │ @@ -895,42 +895,42 @@ │ │ │ │
    │ │ │ │

    Inheritance Mapping Recipes

    │ │ │ │
    │ │ │ │

    Basic Inheritance Mappings

    │ │ │ │

    Working examples of single-table, joined-table, and concrete-table │ │ │ │ inheritance as described in Mapping Class Inheritance Hierarchies.

    │ │ │ │

    Listing of files:

      │ │ │ │ -
    • single.py - Single-table (table-per-hierarchy) inheritance example.

      │ │ │ │ +
    • concrete.py - Concrete-table (table-per-class) inheritance example.

      │ │ │ │

    • │ │ │ │
    • joined.py - Joined-table (table-per-subclass) inheritance example.

      │ │ │ │

    • │ │ │ │ -
    • concrete.py - Concrete-table (table-per-class) inheritance example.

      │ │ │ │ +
    • single.py - Single-table (table-per-hierarchy) inheritance example.

      │ │ │ │

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Special APIs

    │ │ │ │
    │ │ │ │

    Attribute Instrumentation

    │ │ │ │

    Examples illustrating modifications to SQLAlchemy’s attribute management │ │ │ │ system.

    │ │ │ │

    Listing of files:

    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Horizontal Sharding

    │ │ │ │

    A basic example of using the SQLAlchemy Sharding API. │ │ │ │ Sharding refers to horizontally scaling data across multiple │ │ │ │ @@ -961,20 +961,20 @@ │ │ │ │ more plain-spoken alternative, the “distinct entity” approach │ │ │ │ is a simple method of assigning objects to different tables (and potentially │ │ │ │ database nodes) in an explicit way - described on the wiki at │ │ │ │ EntityName.

    │ │ │ │

    Listing of files:

      │ │ │ │
    • separate_databases.py - Illustrates sharding using distinct SQLite databases.

      │ │ │ │

    • │ │ │ │ -
    • separate_schema_translates.py - Illustrates sharding using a single database with multiple schemas, │ │ │ │ -where a different “schema_translates_map” can be used for each shard.

      │ │ │ │ -

    • │ │ │ │
    • separate_tables.py - Illustrates sharding using a single SQLite database, that will however │ │ │ │ have multiple tables using a naming convention.

      │ │ │ │

    • │ │ │ │ +
    • separate_schema_translates.py - Illustrates sharding using a single database with multiple schemas, │ │ │ │ +where a different “schema_translates_map” can be used for each shard.

      │ │ │ │ +

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Extending the ORM

    │ │ │ │
    │ │ │ │ @@ -985,19 +985,19 @@ │ │ │ │ object.

    │ │ │ │

    Examples include demonstrations of the with_loader_criteria() │ │ │ │ option as well as the SessionEvents.do_orm_execute() hook.

    │ │ │ │

    As of SQLAlchemy 1.4, the Query construct is unified │ │ │ │ with the Select construct, so that these two objects │ │ │ │ are mostly the same.

    │ │ │ │

    Listing of files:

      │ │ │ │ +
    • filter_public.py - Illustrates a global criteria applied to entities of a particular type.

      │ │ │ │ +

    • │ │ │ │
    • temporal_range.py - Illustrates a custom per-query criteria that will be applied │ │ │ │ to selected entities.

      │ │ │ │

    • │ │ │ │ -
    • filter_public.py - Illustrates a global criteria applied to entities of a particular type.

      │ │ │ │ -

    • │ │ │ │
    │ │ │ │

    │ │ │ │
    │ │ │ │
    │ │ │ │

    Dogpile Caching

    │ │ │ │

    Illustrates how to embed │ │ │ │ dogpile.cache │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -126,30 +126,31 @@ │ │ │ │ │ Examples illustrating the usage of the “association object” pattern, where an │ │ │ │ │ intermediary class mediates the relationship between two classes that are │ │ │ │ │ associated in a many-to-many pattern. │ │ │ │ │ Listing of files: │ │ │ │ │ * basic_association.py - Illustrate a many-to-many relationship between an │ │ │ │ │ “Order” and a collection of “Item” objects, associating a purchase price │ │ │ │ │ with each via an association object called “OrderItem” │ │ │ │ │ +proxied_association.py - Same example as basic_association, adding in usage of │ │ │ │ │ +sqlalchemy.ext.associationproxy to make explicit references to OrderItem │ │ │ │ │ +optional. │ │ │ │ │ dict_of_sets_with_default.py - An advanced association proxy example which │ │ │ │ │ illustrates nesting of association proxies to produce multi-level Python │ │ │ │ │ collections, in this case a dictionary with string keys and sets of integers as │ │ │ │ │ values, which conceal the underlying mapped classes. │ │ │ │ │ -proxied_association.py - Same example as basic_association, adding in usage of │ │ │ │ │ -sqlalchemy.ext.associationproxy to make explicit references to OrderItem │ │ │ │ │ -optional. │ │ │ │ │ │ │ │ │ │ **** Asyncio Integration¶ **** │ │ │ │ │ Examples illustrating the asyncio engine feature of SQLAlchemy. │ │ │ │ │ Listing of files: │ │ │ │ │ - * async_orm.py - Illustrates use of the sqlalchemy.ext.asyncio.AsyncSession │ │ │ │ │ - object for asynchronous ORM use. │ │ │ │ │ -greenlet_orm.py - Illustrates use of the sqlalchemy.ext.asyncio.AsyncSession │ │ │ │ │ -object for asynchronous ORM use, including the optional run_sync() method. │ │ │ │ │ + * greenlet_orm.py - Illustrates use of the │ │ │ │ │ + sqlalchemy.ext.asyncio.AsyncSession object for asynchronous ORM use, │ │ │ │ │ + including the optional run_sync() method. │ │ │ │ │ basic.py - Illustrates the asyncio engine / connection interface. │ │ │ │ │ +async_orm.py - Illustrates use of the sqlalchemy.ext.asyncio.AsyncSession │ │ │ │ │ +object for asynchronous ORM use. │ │ │ │ │ gather_orm_statements.py - Illustrates how to run many statements concurrently │ │ │ │ │ using asyncio.gather() along many asyncio database connections, merging ORM │ │ │ │ │ results into a single AsyncSession. │ │ │ │ │ │ │ │ │ │ **** Directed Graphs¶ **** │ │ │ │ │ An example of persistence for a directed graph structure. The graph is stored │ │ │ │ │ as a collection of edges, each referencing both a “lower” and an “upper” node │ │ │ │ │ @@ -177,31 +178,31 @@ │ │ │ │ │ Supplier, both subclassing the HasAddresses mixin, which ensures that the │ │ │ │ │ parent class is provided with an addresses collection which contains Address │ │ │ │ │ objects. │ │ │ │ │ The discriminator_on_association.py and generic_fk.py scripts are modernized │ │ │ │ │ versions of recipes presented in the 2007 blog post Polymorphic_Associations │ │ │ │ │ with_SQLAlchemy. │ │ │ │ │ Listing of files: │ │ │ │ │ - * table_per_related.py - Illustrates a generic association which persists │ │ │ │ │ - association objects within individual tables, each one generated to │ │ │ │ │ - persist those objects on behalf of a particular parent class. │ │ │ │ │ + * table_per_association.py - Illustrates a mixin which provides a generic │ │ │ │ │ + association via a individually generated association tables for each │ │ │ │ │ + parent class. The associated objects themselves are persisted in a single │ │ │ │ │ + table shared among all parents. │ │ │ │ │ generic_fk.py - Illustrates a so-called “generic foreign key”, in a similar │ │ │ │ │ fashion to that of popular frameworks such as Django, ROR, etc. This approach │ │ │ │ │ bypasses standard referential integrity practices, in that the “foreign key” │ │ │ │ │ column is not actually constrained to refer to any particular table; instead, │ │ │ │ │ in-application logic is used to determine which table is referenced. │ │ │ │ │ -table_per_association.py - Illustrates a mixin which provides a generic │ │ │ │ │ -association via a individually generated association tables for each parent │ │ │ │ │ -class. The associated objects themselves are persisted in a single table shared │ │ │ │ │ -among all parents. │ │ │ │ │ discriminator_on_association.py - Illustrates a mixin which provides a generic │ │ │ │ │ association using a single target table and a single association table, │ │ │ │ │ referred to by all parent tables. The association table contains a │ │ │ │ │ “discriminator” column which determines what type of parent object associates │ │ │ │ │ to each particular row in the association table. │ │ │ │ │ +table_per_related.py - Illustrates a generic association which persists │ │ │ │ │ +association objects within individual tables, each one generated to persist │ │ │ │ │ +those objects on behalf of a particular parent class. │ │ │ │ │ │ │ │ │ │ **** Large Collections¶ **** │ │ │ │ │ Large collection example. │ │ │ │ │ Illustrates the options to use with relationship() when the list of related │ │ │ │ │ objects is very large, including: │ │ │ │ │ * “dynamic” relationships which query slices of data as accessed │ │ │ │ │ * how to use ON DELETE CASCADE in conjunction with passive_deletes=True to │ │ │ │ │ @@ -262,28 +263,29 @@ │ │ │ │ │ $ python -m examples.performance bulk_inserts \ │ │ │ │ │ --dburl mysql+mysqldb://scott:tiger@localhost/test \ │ │ │ │ │ --profile --num 1000 │ │ │ │ │ See also │ │ │ │ │ How_can_I_profile_a_SQLAlchemy_powered_application? │ │ │ │ │ *** File Listing¶ *** │ │ │ │ │ Listing of files: │ │ │ │ │ - * short_selects.py - This series of tests illustrates different ways to │ │ │ │ │ - SELECT a single record by primary key │ │ │ │ │ -__main__.py - Allows the examples/performance package to be run as a script. │ │ │ │ │ + * single_inserts.py - In this series of tests, we’re looking at a method │ │ │ │ │ + that inserts a row within a distinct transaction, and afterwards returns │ │ │ │ │ + to essentially a “closed” state. This would be analogous to an API call │ │ │ │ │ + that starts up a database connection, inserts the row, commits and │ │ │ │ │ + closes. │ │ │ │ │ +short_selects.py - This series of tests illustrates different ways to SELECT a │ │ │ │ │ +single record by primary key │ │ │ │ │ +bulk_updates.py - This series of tests will illustrate different ways to UPDATE │ │ │ │ │ +a large number of rows in bulk (under construction! there’s just one test at │ │ │ │ │ +the moment) │ │ │ │ │ large_resultsets.py - In this series of tests, we are looking at time to load a │ │ │ │ │ large number of very small and simple rows. │ │ │ │ │ -single_inserts.py - In this series of tests, we’re looking at a method that │ │ │ │ │ -inserts a row within a distinct transaction, and afterwards returns to │ │ │ │ │ -essentially a “closed” state. This would be analogous to an API call that │ │ │ │ │ -starts up a database connection, inserts the row, commits and closes. │ │ │ │ │ +__main__.py - Allows the examples/performance package to be run as a script. │ │ │ │ │ bulk_inserts.py - This series of tests illustrates different ways to INSERT a │ │ │ │ │ large number of rows in bulk. │ │ │ │ │ -bulk_updates.py - This series of tests will illustrate different ways to UPDATE │ │ │ │ │ -a large number of rows in bulk (under construction! there’s just one test at │ │ │ │ │ -the moment) │ │ │ │ │ │ │ │ │ │ *** Running all tests with time¶ *** │ │ │ │ │ This is the default form of run: │ │ │ │ │ $ python -m examples.performance single_inserts │ │ │ │ │ Tests to run: test_orm_commit, test_bulk_save, │ │ │ │ │ test_bulk_insert_dictionaries, test_core, │ │ │ │ │ test_core_query_caching, test_dbapi_raw_w_connect, │ │ │ │ │ @@ -424,20 +426,20 @@ │ │ │ │ │ test_subqueryload : load everything, subquery eager loading. (1000 iterations); │ │ │ │ │ total time 2.977696 sec │ │ │ │ │ │ │ │ │ │ **** Relationship Join Conditions¶ **** │ │ │ │ │ Examples of various relationship() configurations, which make use of the │ │ │ │ │ primaryjoin argument to compose special types of join conditions. │ │ │ │ │ Listing of files: │ │ │ │ │ - * cast.py - Illustrate a relationship() that joins two columns where those │ │ │ │ │ - columns are not of the same type, and a CAST must be used on the SQL side │ │ │ │ │ - in order to match them. │ │ │ │ │ -threeway.py - Illustrate a “three way join” - where a primary table joins to a │ │ │ │ │ -remote table via an association table, but then the primary table also needs to │ │ │ │ │ -refer to some columns in the remote table directly. │ │ │ │ │ + * threeway.py - Illustrate a “three way join” - where a primary table joins │ │ │ │ │ + to a remote table via an association table, but then the primary table │ │ │ │ │ + also needs to refer to some columns in the remote table directly. │ │ │ │ │ +cast.py - Illustrate a relationship() that joins two columns where those │ │ │ │ │ +columns are not of the same type, and a CAST must be used on the SQL side in │ │ │ │ │ +order to match them. │ │ │ │ │ │ │ │ │ │ **** Space Invaders¶ **** │ │ │ │ │ A Space Invaders game using SQLite as the state machine. │ │ │ │ │ Originally developed in 2012. Adapted to work in Python 3. │ │ │ │ │ Runs in a textual console using ASCII art. │ │ │ │ │ [orm/space_invaders.jpg] │ │ │ │ │ To run: │ │ │ │ │ @@ -543,40 +545,40 @@ │ │ │ │ │ def __eq__(self, other): │ │ │ │ │ assert type(other) is SomeClass and other.id == self.id │ │ │ │ │ Above, if two instance of SomeClass with the same version identifier are │ │ │ │ │ updated and sent to the database for UPDATE concurrently, if the database │ │ │ │ │ isolation level allows the two UPDATE statements to proceed, one will fail │ │ │ │ │ because it no longer is against the last known version identifier. │ │ │ │ │ Listing of files: │ │ │ │ │ - * history_meta.py - Versioned mixin class and other utilities. │ │ │ │ │ -test_versioning.py - Unit tests illustrating usage of the history_meta.py │ │ │ │ │ -module functions. │ │ │ │ │ + * test_versioning.py - Unit tests illustrating usage of the history_meta.py │ │ │ │ │ + module functions. │ │ │ │ │ +history_meta.py - Versioned mixin class and other utilities. │ │ │ │ │ │ │ │ │ │ *** Versioning using Temporal Rows¶ *** │ │ │ │ │ Several examples that illustrate the technique of intercepting changes that │ │ │ │ │ would be first interpreted as an UPDATE on a row, and instead turning it into │ │ │ │ │ an INSERT of a new row, leaving the previous row intact as a historical │ │ │ │ │ version. │ │ │ │ │ Compare to the Versioning_with_a_History_Table example which writes a history │ │ │ │ │ row to a separate history table. │ │ │ │ │ Listing of files: │ │ │ │ │ - * versioned_rows_w_versionid.py - Illustrates a method to intercept changes │ │ │ │ │ - on objects, turning an UPDATE statement on a single row into an INSERT │ │ │ │ │ - statement, so that a new row is inserted with the new data, keeping the │ │ │ │ │ - old row intact. │ │ │ │ │ -versioned_update_old_row.py - Illustrates the same UPDATE into INSERT technique │ │ │ │ │ -of versioned_rows.py, but also emits an UPDATE on the old row to affect a │ │ │ │ │ -change in timestamp. Also includes a SessionEvents.do_orm_execute() hook to │ │ │ │ │ -limit queries to only the most recent version. │ │ │ │ │ -versioned_rows.py - Illustrates a method to intercept changes on objects, │ │ │ │ │ -turning an UPDATE statement on a single row into an INSERT statement, so that a │ │ │ │ │ -new row is inserted with the new data, keeping the old row intact. │ │ │ │ │ + * versioned_update_old_row.py - Illustrates the same UPDATE into INSERT │ │ │ │ │ + technique of versioned_rows.py, but also emits an UPDATE on the old row │ │ │ │ │ + to affect a change in timestamp. Also includes a │ │ │ │ │ + SessionEvents.do_orm_execute() hook to limit queries to only the most │ │ │ │ │ + recent version. │ │ │ │ │ versioned_map.py - A variant of the versioned_rows example built around the │ │ │ │ │ concept of a “vertical table” structure, like those illustrated in Vertical │ │ │ │ │ Attribute_Mapping examples. │ │ │ │ │ +versioned_rows.py - Illustrates a method to intercept changes on objects, │ │ │ │ │ +turning an UPDATE statement on a single row into an INSERT statement, so that a │ │ │ │ │ +new row is inserted with the new data, keeping the old row intact. │ │ │ │ │ +versioned_rows_w_versionid.py - Illustrates a method to intercept changes on │ │ │ │ │ +objects, turning an UPDATE statement on a single row into an INSERT statement, │ │ │ │ │ +so that a new row is inserted with the new data, keeping the old row intact. │ │ │ │ │ │ │ │ │ │ **** Vertical Attribute Mapping¶ **** │ │ │ │ │ Illustrates “vertical table” mappings. │ │ │ │ │ A “vertical table” refers to a technique where individual attributes of an │ │ │ │ │ object are stored as distinct rows in a table. The “vertical table” technique │ │ │ │ │ is used to persist objects which can have a varied set of attributes, at the │ │ │ │ │ expense of simple query control and brevity. It is commonly found in content/ │ │ │ │ │ @@ -605,30 +607,30 @@ │ │ │ │ │ dictionary. │ │ │ │ │ │ │ │ │ │ ***** Inheritance Mapping Recipes¶ ***** │ │ │ │ │ **** Basic Inheritance Mappings¶ **** │ │ │ │ │ Working examples of single-table, joined-table, and concrete-table inheritance │ │ │ │ │ as described in Mapping_Class_Inheritance_Hierarchies. │ │ │ │ │ Listing of files: │ │ │ │ │ - * single.py - Single-table (table-per-hierarchy) inheritance example. │ │ │ │ │ + * concrete.py - Concrete-table (table-per-class) inheritance example. │ │ │ │ │ joined.py - Joined-table (table-per-subclass) inheritance example. │ │ │ │ │ -concrete.py - Concrete-table (table-per-class) inheritance example. │ │ │ │ │ +single.py - Single-table (table-per-hierarchy) inheritance example. │ │ │ │ │ │ │ │ │ │ ***** Special APIs¶ ***** │ │ │ │ │ **** Attribute Instrumentation¶ **** │ │ │ │ │ Examples illustrating modifications to SQLAlchemy’s attribute management │ │ │ │ │ system. │ │ │ │ │ Listing of files: │ │ │ │ │ - * custom_management.py - Illustrates customized class instrumentation, │ │ │ │ │ - using the sqlalchemy.ext.instrumentation extension package. │ │ │ │ │ -listen_for_events.py - Illustrates how to attach events to all instrumented │ │ │ │ │ -attributes and listen for change events. │ │ │ │ │ + * listen_for_events.py - Illustrates how to attach events to all │ │ │ │ │ + instrumented attributes and listen for change events. │ │ │ │ │ active_column_defaults.py - Illustrates use of the AttributeEvents.init_scalar │ │ │ │ │ () event, in conjunction with Core column defaults to provide ORM objects that │ │ │ │ │ automatically produce the default value when an un-set attribute is accessed. │ │ │ │ │ +custom_management.py - Illustrates customized class instrumentation, using the │ │ │ │ │ +sqlalchemy.ext.instrumentation extension package. │ │ │ │ │ │ │ │ │ │ **** Horizontal Sharding¶ **** │ │ │ │ │ A basic example of using the SQLAlchemy Sharding API. Sharding refers to │ │ │ │ │ horizontally scaling data across multiple databases. │ │ │ │ │ The basic components of a “sharded” mapping are: │ │ │ │ │ * multiple Engine instances, each assigned a “shard id”. These Engine │ │ │ │ │ instances may refer to different databases, or different schemas / │ │ │ │ │ @@ -652,34 +654,34 @@ │ │ │ │ │ issue of organizing instances among multiple databases. For a more plain-spoken │ │ │ │ │ alternative, the “distinct entity” approach is a simple method of assigning │ │ │ │ │ objects to different tables (and potentially database nodes) in an explicit way │ │ │ │ │ - described on the wiki at EntityName. │ │ │ │ │ Listing of files: │ │ │ │ │ * separate_databases.py - Illustrates sharding using distinct SQLite │ │ │ │ │ databases. │ │ │ │ │ +separate_tables.py - Illustrates sharding using a single SQLite database, that │ │ │ │ │ +will however have multiple tables using a naming convention. │ │ │ │ │ separate_schema_translates.py - Illustrates sharding using a single database │ │ │ │ │ with multiple schemas, where a different “schema_translates_map” can be used │ │ │ │ │ for each shard. │ │ │ │ │ -separate_tables.py - Illustrates sharding using a single SQLite database, that │ │ │ │ │ -will however have multiple tables using a naming convention. │ │ │ │ │ │ │ │ │ │ ***** Extending the ORM¶ ***** │ │ │ │ │ **** ORM Query Events¶ **** │ │ │ │ │ Recipes which illustrate augmentation of ORM SELECT behavior as used by │ │ │ │ │ Session.execute() with 2.0_style use of select(), as well as the 1.x_style │ │ │ │ │ Query object. │ │ │ │ │ Examples include demonstrations of the with_loader_criteria() option as well as │ │ │ │ │ the SessionEvents.do_orm_execute() hook. │ │ │ │ │ As of SQLAlchemy 1.4, the Query construct is unified with the Select construct, │ │ │ │ │ so that these two objects are mostly the same. │ │ │ │ │ Listing of files: │ │ │ │ │ - * temporal_range.py - Illustrates a custom per-query criteria that will be │ │ │ │ │ - applied to selected entities. │ │ │ │ │ -filter_public.py - Illustrates a global criteria applied to entities of a │ │ │ │ │ -particular type. │ │ │ │ │ + * filter_public.py - Illustrates a global criteria applied to entities of a │ │ │ │ │ + particular type. │ │ │ │ │ +temporal_range.py - Illustrates a custom per-query criteria that will be │ │ │ │ │ +applied to selected entities. │ │ │ │ │ │ │ │ │ │ **** Dogpile Caching¶ **** │ │ │ │ │ Illustrates how to embed dogpile.cache functionality with ORM queries, allowing │ │ │ │ │ full cache control as well as the ability to pull “lazy loaded” attributes from │ │ │ │ │ long term cache. │ │ │ │ │ In this demo, the following techniques are illustrated: │ │ │ │ │ * Using the SessionEvents.do_orm_execute() event hook │ │ │ ├── ./usr/share/doc/python-sqlalchemy-doc/html/searchindex.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -8497,20 +8497,20 @@ │ │ │ │ │ "3414": [13, 25], │ │ │ │ │ "alchemy2": 13, │ │ │ │ │ "4644": 13, │ │ │ │ │ "5649": 13, │ │ │ │ │ "get_sequence_nam": [13, 48, 52], │ │ │ │ │ "2056": 13, │ │ │ │ │ "4755": 13, │ │ │ │ │ + "4524": 13, │ │ │ │ │ "upfront": 13, │ │ │ │ │ "returns_unicode_str": [13, 48], │ │ │ │ │ "returns_condit": [13, 59], │ │ │ │ │ "returns_byt": [13, 59], │ │ │ │ │ "5315": 13, │ │ │ │ │ - "4524": 13, │ │ │ │ │ "hundr": [13, 21, 24, 25, 31, 76, 136, 137, 155], │ │ │ │ │ "4645": [13, 25], │ │ │ │ │ "4808": [13, 25], │ │ │ │ │ "5004": [13, 25], │ │ │ │ │ "har": [13, 25], │ │ │ │ │ "4712": 13, │ │ │ │ │ "5526": [13, 25], │ │ │ │ │ @@ -12439,17 +12439,17 @@ │ │ │ │ │ "n5": 98, │ │ │ │ │ "add_neighbor": 98, │ │ │ │ │ "higher_neighbor": 98, │ │ │ │ │ "directed_graph": 98, │ │ │ │ │ "supplier": 98, │ │ │ │ │ "hasaddress": 98, │ │ │ │ │ "generic_fk": 98, │ │ │ │ │ - "table_per_rel": 98, │ │ │ │ │ - "ror": 98, │ │ │ │ │ "table_per_associ": 98, │ │ │ │ │ + "ror": 98, │ │ │ │ │ + "table_per_rel": 98, │ │ │ │ │ "materialized_path": 98, │ │ │ │ │ "nested_set": 98, │ │ │ │ │ "single_insert": 98, │ │ │ │ │ "bulk_upd": 98, │ │ │ │ │ "test_orm_commit": 98, │ │ │ │ │ "test_bulk_insert_dictionari": 98, │ │ │ │ │ "test_cor": 98, │ │ │ │ │ @@ -12504,34 +12504,34 @@ │ │ │ │ │ "sc1": 98, │ │ │ │ │ "sc1modifi": 98, │ │ │ │ │ "someclasshistori": 98, │ │ │ │ │ "__history_mapper__": 98, │ │ │ │ │ "_history_mapp": 98, │ │ │ │ │ "somehistoryclass": 98, │ │ │ │ │ "use_mapper_vers": 98, │ │ │ │ │ - "versioned_rows_w_versionid": 98, │ │ │ │ │ "versioned_update_old_row": 98, │ │ │ │ │ "versioned_map": 98, │ │ │ │ │ + "versioned_rows_w_versionid": 98, │ │ │ │ │ "breviti": 98, │ │ │ │ │ "shrew": 98, │ │ │ │ │ "anim": 98, │ │ │ │ │ "cute": 98, │ │ │ │ │ "weasel": 98, │ │ │ │ │ "poison": 98, │ │ │ │ │ "animalfact": 98, │ │ │ │ │ "custom_manag": 98, │ │ │ │ │ "weather": 98, │ │ │ │ │ "contin": 98, │ │ │ │ │ "spoken": 98, │ │ │ │ │ "separate_databas": 98, │ │ │ │ │ + "separate_t": 98, │ │ │ │ │ "separate_schema_transl": 98, │ │ │ │ │ "schema_translates_map": 98, │ │ │ │ │ - "separate_t": 98, │ │ │ │ │ - "temporal_rang": 98, │ │ │ │ │ "filter_publ": 98, │ │ │ │ │ + "temporal_rang": 98, │ │ │ │ │ "demo": 98, │ │ │ │ │ "datafil": 98, │ │ │ │ │ "helloworld": 98, │ │ │ │ │ "local_session_cach": 98, │ │ │ │ │ "datamodel": 98, │ │ │ │ │ "postalcod": 98, │ │ │ │ │ "citi": [98, 124, 133],