]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Change ``orm.future`` to ``future.orm`` 5240/head
authorFederico Caselli <cfederico87@gmail.com>
Wed, 8 Apr 2020 17:19:02 +0000 (19:19 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 8 Apr 2020 17:21:37 +0000 (19:21 +0200)
Change-Id: I7fcf8b691134a0c52fbbf7879da071a41ec28102

doc/build/changelog/migration_20.rst
doc/build/errors.rst
lib/sqlalchemy/future/__init__.py
lib/sqlalchemy/future/orm/__init__.py [new file with mode: 0644]

index 501a16c5596965234391b936f9c580bf8134bcea..77b4e34af64259dedaadba5a4b03e669dd1cf8a5 100644 (file)
@@ -93,14 +93,14 @@ The steps to achieve this are as follows:
 
 * APIs which are explicitly incompatible with SQLAlchemy 1.x style will be
   available in two new packages ``sqlalchemy.future`` and
-  ``sqlalchemy.orm.future``.  The most prominent objects in these new packages
+  ``sqlalchemy.future.orm``.  The most prominent objects in these new packages
   will be the :func:`sqlalchemy.future.select` object, which now features
   a refined constructor, and additionally will be compatible with ORM
   querying, as well as the new declarative base construct in
-  ``sqlalchemy.orm.future``.
+  ``sqlalchemy.future.orm``.
 
 * SQLAlchemy 2.0 will include the same ``sqlalchemy.future`` and
-  ``sqlalchemy.orm.future`` packages; once an application only needs to run on
+  ``sqlalchemy.future.orm`` packages; once an application only needs to run on
   SQLAlchemy 2.0 (as well as Python 3 only of course :) ), the "future" imports
   can be changed to refer to the canonical import, for example ``from
   sqlalchemy.future import select`` becomes ``from sqlalchemy import select``.
@@ -487,7 +487,7 @@ longer.   The signature "in spirit" would be::
 The interim signature will be::
 
     # 1.4 / 2.0 using sqlalchemy.future.create_engine,
-    # sqlalchemy.orm.future.Session / sessionmaker / etc
+    # sqlalchemy.future.orm.Session / sessionmaker / etc
 
     def execute(self, statement, _params=None, **options):
 
@@ -599,7 +599,7 @@ such as ``row["some_column"]`` can be used.
 In order to receive results as mappings up front, the ``mappings()`` modifier
 on the result can be used::
 
-    from sqlalchemy.orm.future import Session
+    from sqlalchemy.future.orm import Session
 
     session = Session(some_engine)
 
@@ -634,7 +634,7 @@ Declarative becomes a first class API
   be integrating the declarative documentation appropriately.
 
 Declarative will now be part of ``sqlalchemy.orm`` in 2.0, and in 1.4 the
-new version will be present in ``sqlalchemy.orm.future``.   The concept
+new version will be present in ``sqlalchemy.future.orm``.   The concept
 of the ``Base`` class will be there as it is now and do the same thing
 it already does, however it will also have some new capabilities.
 
@@ -707,7 +707,7 @@ to where the ``declarative_mapper()`` function was called.   However, we
 can just as easily add the above ``mapper()`` function to any declarative base,
 to make for a pattern such as::
 
-    from sqlalchemy.orm.future import declarative_base
+    from sqlalchemy.future.orm import declarative_base
 
     base = declarative_base()
 
@@ -769,7 +769,7 @@ then when delivered to the ``.invoke()`` or ``.execute()`` method of
     from sqlalchemy.future import select
     stmt = select(User).join(User.addresses).where(Address.email == 'foo@bar.com')
 
-    from sqlalchemy.orm.future import Session
+    from sqlalchemy.future.orm import Session
     session = Session(some_engine)
 
     rows = session.execute(stmt).all()
index be77da3e7e8de284052d35f2f9c78950050ec85c..ed5583b1215b5281d25ae7c6c3cb887d9ed7a84d 100644 (file)
@@ -58,7 +58,7 @@ warning is at the base of this system to provide guidance on what behaviors in
 an existing codebase will need to be modified.
 
 For some occurrences of this warning, an additional recommendation to use an
-API in either the ``sqlalchemy.future`` or  ``sqlalchemy.orm.future`` packages
+API in either the ``sqlalchemy.future`` or  ``sqlalchemy.future.orm`` packages
 may be present.  This refers to two  special future-compatibility packages that
 are part of SQLAlchemy 1.4 and  are there to help migrate an application to the
 2.0 version.
index f8836112ec61f89af14a6949ad0887776d75db49..d38d27d8847c55044a3f7aadd9d91dc2741f26a7 100644 (file)
@@ -5,7 +5,7 @@
 # This module is part of SQLAlchemy and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
 
-"""Future 2.0 API features for Core.
+"""Future 2.0 API features.
 
 """
 
diff --git a/lib/sqlalchemy/future/orm/__init__.py b/lib/sqlalchemy/future/orm/__init__.py
new file mode 100644 (file)
index 0000000..56b5dfa
--- /dev/null
@@ -0,0 +1,10 @@
+# sql/future/orm/__init__.py
+# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+"""Future 2.0 API features for Orm.
+
+"""