Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
constructive communication between users and developers.
Please see our current Code of Conduct at
-[Code of Conduct](http://www.sqlalchemy.org/codeofconduct.html).
\ No newline at end of file
+[Code of Conduct](https://www.sqlalchemy.org/codeofconduct.html).
\ No newline at end of file
of [well written bug reports](https://github.com/sqlalchemy/sqlalchemy/issues?q=is%3Aissue+label%3A%22great+mcve%22). Each of these reports include the following features:
1. a **succinct description of the problem** - typically a line or two at most
-2. **succinct, dependency-free code which reproduces the problem**, otherwise known as a [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example.
+2. **succinct, dependency-free code which reproduces the problem**, otherwise known as a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example.
3. **complete stack traces for all errors - please avoid screenshots, use formatted text inside issues**
4. Other things as applicable: **SQL log output**, **database backend and DBAPI driver**,
**operating system**, **comparative performance timings** for performance issues.
<!-- A clear and concise description of what the bug is. -->
**To Reproduce**
-Provide your [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example
+Provide your [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example
here.
```py
For an index of all changelogs, please see:
-* On the web: http://www.sqlalchemy.org/docs/latest/changelog/
+* On the web: https://www.sqlalchemy.org/docs/latest/changelog/
* In the source tree: /doc/build/changelog/
* In the released distribution tree: /doc/changelog/index.html
Latest documentation is at:
-http://www.sqlalchemy.org/docs/
+https://www.sqlalchemy.org/docs/
Installation / Requirements
---------------------------
Full documentation for installation is at
-`Installation <http://www.sqlalchemy.org/docs/intro.html#installation>`_.
+`Installation <https://www.sqlalchemy.org/docs/intro.html#installation>`_.
Getting Help / Development / Bug reporting
------------------------------------------
-Please refer to the `SQLAlchemy Community Guide <http://www.sqlalchemy.org/support.html>`_.
+Please refer to the `SQLAlchemy Community Guide <https://www.sqlalchemy.org/support.html>`_.
Code of Conduct
---------------
Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
constructive communication between users and developers.
Please see our current Code of Conduct at
-`Code of Conduct <http://www.sqlalchemy.org/codeofconduct.html>`_.
+`Code of Conduct <https://www.sqlalchemy.org/codeofconduct.html>`_.
License
-------
SQLAlchemy is distributed under the `MIT license
-<http://www.opensource.org/licenses/mit-license.php>`_.
+<https://www.opensource.org/licenses/mit-license.php>`_.
lazy loads will not fire off for an object that does not have a
database identity (why?
- see http://www.sqlalchemy.org/trac/wiki/WhyDontForeignKeysLoadData)
+ see https://www.sqlalchemy.org/trac/wiki/WhyDontForeignKeysLoadData)
.. change::
:tags:
:tickets:
migration guide is available on the Wiki at
- http://www.sqlalchemy.org/trac/wiki/02Migration
+ https://www.sqlalchemy.org/trac/wiki/02Migration
convert_unicode logic disabled in the sqlite dialect,
to adjust for pysqlite 2.5.0's new requirement that
only Python unicode objects are accepted;
- http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
+ https://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
.. change::
:tags: oracle
:tickets:
(see 0.4.0beta1 for the start of major changes against 0.3,
- as well as http://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 )
+ as well as https://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 )
.. change::
:tags:
Added enable_assertions(False) to Query which disables
the usual assertions for expected state - used
by Query subclasses to engineer custom state.. See
- http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery
+ https://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery
for an example.
.. change::
Call session.add() if you'd like a free-standing object to be
part of your session. Otherwise, a DIY version of
Session.mapper is now documented at
- http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
+ https://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
The method will remain deprecated throughout 0.6.
.. change::
logic disabled in the sqlite dialect, to adjust for pysqlite
2.5.0's new requirement that only Python unicode objects are
accepted;
- http://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
+ https://itsystementwicklung.de/pipermail/list-pysqlite/2008-March/000018.html
.. change::
:tags: mysql
:tickets:
The "entity_name" feature of SQLAlchemy mappers has been
- removed. For rationale, see http://tinyurl.com/6nm2ne
+ removed. For rationale, see https://tinyurl.com/6nm2ne
.. change::
:tags: orm
:tickets:
For the full set of feature descriptions, see
- http://docs.sqlalchemy.org/en/latest/changelog/migration_06.html .
+ https://docs.sqlalchemy.org/en/latest/changelog/migration_06.html .
This document is a work in progress.
.. change::
in favor of "load=False".
* ScopedSession.mapper remains deprecated. See the
usage recipe at
- http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
+ https://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
* passing an InstanceState (internal SQLAlchemy state object) to
attributes.init_collection() or attributes.get_history() is
deprecated. These functions are public API and normally
you want to emit IN) and now emits a deprecation warning.
To get the 0.8 behavior immediately and remove the warning,
a compiler recipe is given at
- http://www.sqlalchemy.org/docs/07/dialects/mssql.html#scalar-select-comparisons
+ https://www.sqlalchemy.org/docs/07/dialects/mssql.html#scalar-select-comparisons
to override the behavior of visit_binary().
.. change::
This section documents those changes from 0.7b4
to 0.7.0. For an overview of what's new in
SQLAlchemy 0.7, see
- http://docs.sqlalchemy.org/en/latest/changelog/migration_07.html
+ https://docs.sqlalchemy.org/en/latest/changelog/migration_07.html
.. change::
:tags: orm
Detailed descriptions of each change below are
described at:
- http://docs.sqlalchemy.org/en/latest/changelog/migration_07.html
+ https://docs.sqlalchemy.org/en/latest/changelog/migration_07.html
.. change::
:tags: general
:tags: requirements
:versions: 0.9.0b1
- The Python `mock <https://pypi.python.org/pypi/mock>`_ library
+ The Python `mock <https://pypi.org/project/mock>`_ library
is now required in order to run the unit test suite. While part
of the standard library as of Python 3.3, previous Python installations
will need to install this in order to run unit tests or to
:tags: sqlite, bug
Support has been added to SQLite type reflection to fully support
- the "type affinity" contract specified at http://www.sqlite.org/datatype3.html.
+ the "type affinity" contract specified at https://www.sqlite.org/datatype3.html.
In this scheme, keywords like ``INT``, ``CHAR``, ``BLOB`` or
``REAL`` located in the type name generically associate the type with
one of five affinities. Pull request courtesy Erich Blume.
Available at the Engine and ORM level. ORM docs so far:
-http://www.sqlalchemy.org/docs/04/session.html#unitofwork_managing
+https://www.sqlalchemy.org/docs/04/session.html#unitofwork_managing
Two-Phase Commit Sessions
^^^^^^^^^^^^^^^^^^^^^^^^^
Available at the Engine and ORM level. ORM docs so far:
-http://www.sqlalchemy.org/docs/04/session.html#unitofwork_managing
+https://www.sqlalchemy.org/docs/04/session.html#unitofwork_managing
Inheritance
-----------
Polymorphic Inheritance with No Joins or Unions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-New docs for inheritance: http://www.sqlalchemy.org/docs/04
+New docs for inheritance: https://www.sqlalchemy.org/docs/04
/mappers.html#advdatamapping_mapper_inheritance_joined
Better Polymorphic Behavior with ``get()``
Custom Subclasses of ``sqlalchemy.types.TypeDecorator``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-There is a `New API <http://www.sqlalchemy.org/docs/04/types
+There is a `New API <https://www.sqlalchemy.org/docs/04/types
.html#types_custom>`_ for subclassing a TypeDecorator.
Using the 0.3 API causes compilation errors in some cases.
<name>_<number> format now. SQL is much easier to read and
is compatible with plan optimizer caches. Just check out
some of the examples in the tutorials:
-http://www.sqlalchemy.org/docs/04/ormtutorial.html
-http://www.sqlalchemy.org/docs/04/sqlexpression.html
+https://www.sqlalchemy.org/docs/04/ormtutorial.html
+https://www.sqlalchemy.org/docs/04/sqlexpression.html
Generative select() Constructs
------------------------------
SQL operators and more or less every SQL keyword there is
are now abstracted into the compiler layer. They now act
intelligently and are type/backend aware, see:
-http://www.sqlalchemy.org/docs/04/sqlexpression.html#sql_operators
+https://www.sqlalchemy.org/docs/04/sqlexpression.html#sql_operators
All ``type`` Keyword Arguments Renamed to ``type_``
---------------------------------------------------
migrating their applications from the 0.4 series of
SQLAlchemy to 0.5. It's also recommended for those working
from `Essential SQLAlchemy
-<http://oreilly.com/catalog/9780596516147/>`_, which only
+<https://oreilly.com/catalog/9780596516147/>`_, which only
covers 0.4 and seems to even have some old 0.3isms in it.
Note that SQLAlchemy 0.5 removes many behaviors which were
deprecated throughout the span of the 0.4 series, and also
state, commits and rollbacks.
* `ORM Tutorial
- <http://www.sqlalchemy.org/docs/05/ormtutorial.html>`_
+ <https://www.sqlalchemy.org/docs/05/ormtutorial.html>`_
* `Session Documentation
- <http://www.sqlalchemy.org/docs/05/session.html>`_
+ <https://www.sqlalchemy.org/docs/05/session.html>`_
Deprecations Source
===================
* **Column level expressions within Query.** - as detailed
in the `tutorial
- <http://www.sqlalchemy.org/docs/05/ormtutorial.html>`_,
+ <https://www.sqlalchemy.org/docs/05/ormtutorial.html>`_,
``Query`` has the capability to create specific SELECT
statements, not just those against full rows:
single class, break the class into separate subclasses and
map them separately. An example of this is at
[wiki:UsageRecipes/EntityName]. More information
- regarding rationale is described at http://groups.google.c
+ regarding rationale is described at https://groups.google.c
om/group/sqlalchemy/browse_thread/thread/9e23a0641a88b96d?
hl=en .
Important Dialect Links:
* Documentation on connect arguments:
- http://www.sqlalchemy.org/docs/06/dbengine.html#create-
+ https://www.sqlalchemy.org/docs/06/dbengine.html#create-
engine-url-arguments.
-* Reference documentation for individual dialects: http://ww
+* Reference documentation for individual dialects: https://ww
w.sqlalchemy.org/docs/06/reference/dialects/index.html
* The tips and tricks at DatabaseNotes.
the first element into a subquery (which is also compatible
on PG). A new example is in the SQL expression tutorial at
the end of
-[http://www.sqlalchemy.org/docs/06/sqlexpression.html
+[https://www.sqlalchemy.org/docs/06/sqlexpression.html
#unions-and-other-set-operations]. See :ticket:`1665` and
r6690 for more background.
Unicode type is used explicitly, a warning is raised if the
object is a bytestring. This warning can be suppressed or
converted to an exception using the Python warnings filter
-documented at: http://docs.python.org/library/warnings.html
+documented at: https://docs.python.org/library/warnings.html
Generic Enum Type
-----------------
in favor of "load=False".
* ``ScopedSession.mapper`` remains deprecated. See the
- usage recipe at http://www.sqlalchemy.org/trac/wiki/Usag
+ usage recipe at https://www.sqlalchemy.org/trac/wiki/Usag
eRecipes/SessionAwareMapper
* passing an ``InstanceState`` (internal SQLAlchemy state
SQLSoup has been modernized and updated to reflect common
0.5/0.6 capabilities, including well defined session
-integration. Please read the new docs at [http://www.sqlalc
+integration. Please read the new docs at [https://www.sqlalc
hemy.org/docs/06/reference/ext/sqlsoup.html].
Declarative
This no longer works, the ``DeclarativeMeta`` constructor
now ignores ``dict_``. Instead, the class attributes should
be assigned directly, e.g. ``cls.id=Column(...)``, or the
-`MixIn class <http://www.sqlalchemy.org/docs/reference/ext/d
+`MixIn class <https://www.sqlalchemy.org/docs/reference/ext/d
eclarative.html#mix-in-classes>`_ approach should be used
instead of the metaclass approach.
A demonstration of callcount reduction including a sample
benchmark script is at
-http://techspot.zzzeek.org/2010/12/12/a-tale-of-three-
+https://techspot.zzzeek.org/2010/12/12/a-tale-of-three-
profiles/
Composites Rewritten
The major backwards-incompatible change of composites is
that they no longer use the ``mutable=True`` system to
detect in-place mutations. Please use the `Mutation
-Tracking <http://www.sqlalchemy.org/docs/07/orm/extensions/m
+Tracking <https://www.sqlalchemy.org/docs/07/orm/extensions/m
utable.html>`_ extension to establish in-place change events
to existing composite usage.
# ... etc
`Querying with Joins
-<http://www.sqlalchemy.org/docs/07/orm/tutorial.html
+<https://www.sqlalchemy.org/docs/07/orm/tutorial.html
#querying-with-joins>`_
:ticket:`1923`
accept positional arguments which are rendered as DISTINCT
ON when a PostgreSQL backend is used.
-`distinct() <http://www.sqlalchemy.org/docs/07/core/expressi
+`distinct() <https://www.sqlalchemy.org/docs/07/core/expressi
on_api.html#sqlalchemy.sql.expression.Select.distinct>`_
-`Query.distinct() <http://www.sqlalchemy.org/docs/07/orm/que
+`Query.distinct() <https://www.sqlalchemy.org/docs/07/orm/que
ry.html#sqlalchemy.orm.query.Query.distinct>`_
:ticket:`1069`
__tablename__ = 'user'
id = Column('id', Integer, primary_key=True)
-`Indexes <http://www.sqlalchemy.org/docs/07/core/schema.html
+`Indexes <https://www.sqlalchemy.org/docs/07/core/schema.html
#indexes>`_
Window Function SQL Construct
site, where window functions have been supported since
version 8.4:
-http://www.postgresql.org/docs/9.0/static/tutorial-
+https://www.postgresql.org/docs/9.0/static/tutorial-
window.html
SQLAlchemy provides a simple construct typically invoked via
avg(empsalary.salary) OVER (PARTITION BY empsalary.depname) AS avg
FROM empsalary
-`sqlalchemy.sql.expression.over <http://www.sqlalchemy.org/d
+`sqlalchemy.sql.expression.over <https://www.sqlalchemy.org/d
ocs/07/core/expression_api.html#sqlalchemy.sql.expression.ov
er>`_
Transaction isolation support is currently only supported by
the PostgreSQL and SQLite backends.
-`execution_options() <http://www.sqlalchemy.org/docs/07/core
+`execution_options() <https://www.sqlalchemy.org/docs/07/core
/connections.html#sqlalchemy.engine.base.Connection.executio
n_options>`_
* a MySQLdb driver for the Drizzle database:
- `Drizzle <http://www.sqlalchemy.org/docs/07/dialects/drizz
+ `Drizzle <https://www.sqlalchemy.org/docs/07/dialects/drizz
le.html>`_
* support for the pymysql DBAPI:
`pymsql Notes
- <http://www.sqlalchemy.org/docs/07/dialects/mysql.html
+ <https://www.sqlalchemy.org/docs/07/dialects/mysql.html
#module-sqlalchemy.dialects.mysql.pymysql>`_
* psycopg2 now works with Python 3
use those custom arguments with both the ``execute()`` and
``connection()`` methods equally.
-`Session.connection <http://www.sqlalchemy.org/docs/07/orm/s
+`Session.connection <https://www.sqlalchemy.org/docs/07/orm/s
ession.html#sqlalchemy.orm.session.Session.connection>`_
-`Session.execute <http://www.sqlalchemy.org/docs/07/orm/sess
+`Session.execute <https://www.sqlalchemy.org/docs/07/orm/sess
ion.html#sqlalchemy.orm.session.Session.execute>`_
:ticket:`1996`
)
The ``mutable=True`` flag is being phased out, in favor of
-the new `Mutation Tracking <http://www.sqlalchemy.org/docs/0
+the new `Mutation Tracking <https://www.sqlalchemy.org/docs/0
7/orm/extensions/mutable.html>`_ extension. This extension
provides a mechanism by which user-defined datatypes can
provide change events back to the owning parent or parents.
So-called "composite" mapped attributes, those configured
using the technique described at `Composite Column Types
-<http://www.sqlalchemy.org/docs/07/orm/mapper_config.html
+<https://www.sqlalchemy.org/docs/07/orm/mapper_config.html
#composite-column-types>`_, have been re-implemented such
that the ORM internals are no longer aware of them (leading
to shorter and more efficient codepaths in critical
sections). While composite types are generally intended to
be treated as immutable value objects, this was never
enforced. For applications that use composites with
-mutability, the `Mutation Tracking <http://www.sqlalchemy.or
+mutability, the `Mutation Tracking <https://www.sqlalchemy.or
g/docs/07/orm/extensions/mutable.html>`_ extension offers a
base class which establishes a mechanism for user-defined
composite types to send change event messages back to the
Note that this change **breaks temporary tables used across
Session commits**, due to the way SQLite handles temp
tables. See the note at
-http://www.sqlalchemy.org/docs/dialects/sqlite.html#using-
+https://www.sqlalchemy.org/docs/dialects/sqlite.html#using-
temporary-tables-with-sqlite if temporary tables beyond the
scope of one pool connection are desired.
implementation was never reasonable and forced a very
inefficient mode of usage on the unit-of-work which caused
an expensive scan of all objects to take place during flush.
-In 0.7, the `sqlalchemy.ext.mutable <http://docs.sqlalchemy.
+In 0.7, the `sqlalchemy.ext.mutable <https://docs.sqlalchemy.
org/en/latest/orm/extensions/mutable.html>`_ extension was
introduced so that user-defined datatypes can appropriately
send events to the unit of work as changes occur.
For whatever reason, the Python function ``unquote_plus()`` was applied to the
"password" field of a URL, which is an incorrect application of the
-encoding rules described in `RFC 1738 <http://www.ietf.org/rfc/rfc1738.txt>`_
+encoding rules described in `RFC 1738 <https://www.ietf.org/rfc/rfc1738.txt>`_
in that it escaped spaces as plus signs. The stringification of a URL
now only encodes ":", "@", or "/" and nothing else, and is now applied to both the
``username`` and ``password`` fields (previously it only applied to the
:mod:`sqlalchemy.dialects.firebird.kinterbasdb`
- http://pythonhosted.org/fdb/usage-guide.html#retaining-transactions - information
+ https://pythonhosted.org/fdb/usage-guide.html#retaining-transactions - information
on the "retaining" flag.
:ticket:`2763`
default associated with TIMESTAMP columns by emitting NULL for
such a type, if the column is set up with ``nullable=True``. However,
MySQL 5.6.6 and above features a new flag
-`explicit_defaults_for_timestamp <http://dev.mysql.com/doc/refman/
+`explicit_defaults_for_timestamp <https://dev.mysql.com/doc/refman/
5.6/en/server-system-variables.html
#sysvar_explicit_defaults_for_timestamp>`_ which repairs MySQL's non-standard
behavior to make it behave like any other type; to accommodate this,
Drizzle Dialect is now an External Dialect
------------------------------------------
-The dialect for `Drizzle <http://www.drizzle.org/>`_ is now an external
+The dialect for `Drizzle <https://www.drizzle.org/>`_ is now an external
dialect, available at https://bitbucket.org/zzzeek/sqlalchemy-drizzle.
This dialect was added to SQLAlchemy right before SQLAlchemy was able to
accommodate third party dialects well; going forward, all databases that aren't
A lot of testing went into making sure this wrapper works correctly, including
for elaborate schemes like that of the
-`Custom Value Object <http://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/>`_
+`Custom Value Object <https://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/>`_
recipe, however we'll be looking to see that no other regressions occur for
users.
Support for PyGreSQL
--------------------
-The `PyGreSQL <https://pypi.python.org/pypi/PyGreSQL>`_ DBAPI is now supported.
+The `PyGreSQL <https://pypi.org/project/PyGreSQL>`_ DBAPI is now supported.
.. seealso::
The psycopg2 ``cursor.executemany()`` method has been identified as performing
poorly, particularly with INSERT statements. To alleviate this, psycopg2
-has added `Fast Execution Helpers <http://initd.org/psycopg/docs/extras.html#fast-execution-helpers>`_
+has added `Fast Execution Helpers <https://initd.org/psycopg/docs/extras.html#fast-execution-helpers>`_
which rework statements into fewer server round trips by sending multiple
DML statements in batch. SQLAlchemy 1.2 now includes support for these
helpers to be used transparently whenever the :class:`_engine.Engine` makes use
This means that an error message that previously looked like this::
- sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id' [SQL: 'select * from reviews\nwhere id = ?'] (Background on this error at: http://sqlalche.me/e/cd3x)
+ sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id' [SQL: 'select * from reviews\nwhere id = ?'] (Background on this error at: https://sqlalche.me/e/cd3x)
Will now look like this::
sqlalchemy.exc.StatementError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter 'id'
[SQL: select * from reviews
where id = ?]
- (Background on this error at: http://sqlalche.me/e/cd3x)
+ (Background on this error at: https://sqlalche.me/e/cd3x)
The primary impact of this change is that consumers can no longer assume that
a complete exception message is on a single line, however the original
With warnings turned on, our program now has a lot to say::
$ SQLALCHEMY_WARN_20=1 python2 -W always::DeprecationWarning test3.py
- test3.py:9: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ test3.py:9: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
engine.execute("CREATE TABLE foo (id integer)")
- /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:2856: RemovedIn20Warning: Passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:2856: RemovedIn20Warning: Passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
return connection.execute(statement, *multiparams, **params)
- /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:1639: RemovedIn20Warning: The current statement is being autocommitted using implicit autocommit.Implicit autocommit will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:1639: RemovedIn20Warning: The current statement is being autocommitted using implicit autocommit.Implicit autocommit will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
self._commit_impl(autocommit=True)
- test3.py:10: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ test3.py:10: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
engine.execute("INSERT INTO foo (id) VALUES (1)")
- /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:2856: RemovedIn20Warning: Passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:2856: RemovedIn20Warning: Passing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
return connection.execute(statement, *multiparams, **params)
- /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:1639: RemovedIn20Warning: The current statement is being autocommitted using implicit autocommit.Implicit autocommit will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ /home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py:1639: RemovedIn20Warning: The current statement is being autocommitted using implicit autocommit.Implicit autocommit will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
self._commit_impl(autocommit=True)
- /home/classic/dev/sqlalchemy/lib/sqlalchemy/sql/selectable.py:4271: RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select(). (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ /home/classic/dev/sqlalchemy/lib/sqlalchemy/sql/selectable.py:4271: RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select(). (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
return cls.create_legacy_select(*args, **kw)
- test3.py:14: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)
+ test3.py:14: RemovedIn20Warning: The Engine.execute() function/method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
result = engine.execute(select([foo.c.id]))
[(1,)]
# how to render changelog links
-changelog_render_ticket = "http://www.sqlalchemy.org/trac/ticket/%s"
+changelog_render_ticket = "https://www.sqlalchemy.org/trac/ticket/%s"
changelog_render_pullreq = {
"default": "https://github.com/sqlalchemy/sqlalchemy/pull/%s",
"github": "https://github.com/sqlalchemy/sqlalchemy/pull/%s",
}
-changelog_render_changeset = "http://www.sqlalchemy.org/trac/changeset/%s"
+changelog_render_changeset = "https://www.sqlalchemy.org/trac/changeset/%s"
exclude_patterns = ["build", "**/unreleased*/*", "*_include.rst"]
release_date = "June 28, 2021"
-site_base = os.environ.get("RTD_SITE_BASE", "http://www.sqlalchemy.org")
+site_base = os.environ.get("RTD_SITE_BASE", "https://www.sqlalchemy.org")
site_adapter_template = "docs_adapter.mako"
site_adapter_py = "docs_adapter.py"
Appendix: Copyright
====================
-This is the MIT license: `<http://www.opensource.org/licenses/mit-license.php>`_
+This is the MIT license: `<https://www.opensource.org/licenses/mit-license.php>`_
Copyright (c) 2005-2021 Michael Bayer and contributors.
SQLAlchemy is a trademark of Michael Bayer.
-------------------------
For stored procedures with special syntactical or parameter concerns,
-DBAPI-level `callproc <http://legacy.python.org/dev/peps/pep-0249/#callproc>`_
+DBAPI-level `callproc <https://legacy.python.org/dev/peps/pep-0249/#callproc>`_
may be used::
connection = engine.raw_connection()
--------------------
Multiple result set support is available from a raw DBAPI cursor using the
-`nextset <http://legacy.python.org/dev/peps/pep-0249/#nextset>`_ method::
+`nextset <https://legacy.python.org/dev/peps/pep-0249/#nextset>`_ method::
connection = engine.raw_connection()
try:
The :func:`_sa.create_engine` function produces an :class:`_engine.Engine` object based
on a URL. These URLs follow `RFC-1738
-<http://rfc.net/rfc1738.html>`_, and usually can include username, password,
+<https://rfc.net/rfc1738.html>`_, and usually can include username, password,
hostname, database name as well as optional keyword arguments for additional configuration.
In some cases a file path is accepted, and in others a "data source name" replaces
the "host" and "database" portions. The typical form of a database URL is::
===================
Python's standard `logging
-<http://docs.python.org/library/logging.html>`_ module is used to
+<https://docs.python.org/library/logging.html>`_ module is used to
implement informational and debug log output with SQLAlchemy. This allows
SQLAlchemy's logging to integrate in a standard way with other applications
and libraries. There are also two parameters
Language, the similarities are more superficial than they may at first appear.
One approaches the structure and content of data from the perspective of a
user-defined `domain model
-<http://en.wikipedia.org/wiki/Domain_model>`_ which is transparently
+<https://en.wikipedia.org/wiki/Domain_model>`_ which is transparently
persisted and refreshed from its underlying storage model. The other
approaches it from the perspective of literal schema and SQL expression
representations which are explicitly composed into messages consumed
.. _PyHive: https://github.com/dropbox/PyHive#sqlalchemy
.. _teradatasqlalchemy: https://pypi.org/project/teradatasqlalchemy/
.. _pybigquery: https://github.com/mxmzdlv/pybigquery/
-.. _sqlalchemy-redshift: https://pypi.python.org/pypi/sqlalchemy-redshift
+.. _sqlalchemy-redshift: https://pypi.org/project/sqlalchemy-redshift
.. _sqlalchemy-drill: https://github.com/JohnOmernik/sqlalchemy-drill
.. _sqlalchemy-hana: https://github.com/SAP/sqlalchemy-hana
.. _sqlalchemy-solr: https://github.com/aadel/sqlalchemy-solr
InnoDB. Any connection that is still inside an old transaction will return
stale data, if that data was already queried on that connection within
isolation. For background on why you might see stale data even on MySQL, see
-http://dev.mysql.com/doc/refman/5.1/en/innodb-transaction-model.html
+https://dev.mysql.com/doc/refman/5.1/en/innodb-transaction-model.html
I'm on MyISAM - how do I turn it off?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
functions, and behaviors related to the linkages between schema objects such as
constraint conventions or naming conventions using attachment events.
An example of many of these
-techniques can be seen at `Naming Conventions <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/NamingConventions>`_.
+techniques can be seen at `Naming Conventions <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/NamingConventions>`_.
In almost all cases, a table does have a so-called :term:`candidate key`, which is a column or series
of columns that uniquely identify a row. If a table truly doesn't have this, and has actual
-fully duplicate rows, the table is not corresponding to `first normal form <http://en.wikipedia.org/wiki/First_normal_form>`_ and cannot be mapped. Otherwise, whatever columns comprise the best candidate key can be
+fully duplicate rows, the table is not corresponding to `first normal form <https://en.wikipedia.org/wiki/First_normal_form>`_ and cannot be mapped. Otherwise, whatever columns comprise the best candidate key can be
applied directly to the mapper::
class SomeClass(Base):
SQLAlchemy Core: Total time for 100000 records 0.21024107933 secs
sqlite3: Total time for 100000 records 0.137335062027 sec
-We can reduce the time by a factor of nearly three using recent versions of `PyPy <http://pypy.org/>`_::
+We can reduce the time by a factor of nearly three using recent versions of `PyPy <https://pypy.org/>`_::
SQLAlchemy ORM: Total time for 100000 records 2.39429616928 secs
SQLAlchemy ORM pk given: Total time for 100000 records 1.51412987709 secs
How do I make a Query that always adds a certain filter to every query?
------------------------------------------------------------------------------------------------
-See the recipe at `FilteredQuery <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/FilteredQuery>`_.
+See the recipe at `FilteredQuery <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/FilteredQuery>`_.
.. _faq_query_deduplicating:
specific programming scenarios encountered by users which involve the repurposing
of the ORM's usual object states.
-The recipe `ExpireRelationshipOnFKChange <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ExpireRelationshipOnFKChange>`_ features an example using SQLAlchemy events
+The recipe `ExpireRelationshipOnFKChange <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/ExpireRelationshipOnFKChange>`_ features an example using SQLAlchemy events
in order to coordinate the setting of foreign key attributes with many-to-one
relationships.
fact that if you create the same ``Keyword`` twice, it gets put in the DB twice.
Which is somewhat inconvenient.
-This `UniqueObject <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject>`_ recipe was created to address this issue.
+This `UniqueObject <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject>`_ recipe was created to address this issue.
.. _faq_post_update_update:
In Python, a descriptor is an object attribute with “binding behavior”,
one whose attribute access has been overridden by methods in the
- `descriptor protocol <http://docs.python.org/howto/descriptor.html>`_.
+ `descriptor protocol <https://docs.python.org/howto/descriptor.html>`_.
Those methods are ``__get__()``, ``__set__()``, and ``__delete__()``.
If any of those methods are defined for an object, it is said to be a
descriptor.
:ref:`metadata_toplevel`
- `DDL (via Wikipedia) <http://en.wikipedia.org/wiki/Data_definition_language>`_
+ `DDL (via Wikipedia) <https://en.wikipedia.org/wiki/Data_definition_language>`_
:term:`DML`
.. seealso::
- `DML (via Wikipedia) <http://en.wikipedia.org/wiki/Data_manipulation_language>`_
+ `DML (via Wikipedia) <https://en.wikipedia.org/wiki/Data_manipulation_language>`_
:term:`DDL`
.. seealso::
- `Identity Map (via Martin Fowler) <http://martinfowler.com/eaaCatalog/identityMap.html>`_
+ `Identity Map (via Martin Fowler) <https://martinfowler.com/eaaCatalog/identityMap.html>`_
lazy initialization
A tactic of delaying some initialization action, such as creating objects,
.. seealso::
- `Lazy Load (via Martin Fowler) <http://martinfowler.com/eaaCatalog/lazyLoad.html>`_
+ `Lazy Load (via Martin Fowler) <https://martinfowler.com/eaaCatalog/lazyLoad.html>`_
:term:`N plus one problem`
.. seealso::
- `PEP 249 - Python Database API Specification v2.0 <http://www.python.org/dev/peps/pep-0249/>`_
+ `PEP 249 - Python Database API Specification v2.0 <https://www.python.org/dev/peps/pep-0249/>`_
domain model
.. seealso::
- `Domain Model (via Wikipedia) <http://en.wikipedia.org/wiki/Domain_model>`_
+ `Domain Model (via Wikipedia) <https://en.wikipedia.org/wiki/Domain_model>`_
unit of work
This pattern is where the system transparently keeps
.. seealso::
- `Unit of Work (via Martin Fowler) <http://martinfowler.com/eaaCatalog/unitOfWork.html>`_
+ `Unit of Work (via Martin Fowler) <https://martinfowler.com/eaaCatalog/unitOfWork.html>`_
:doc:`orm/session`
:term:`durability`
- `ACID Model (via Wikipedia) <http://en.wikipedia.org/wiki/ACID_Model>`_
+ `ACID Model (via Wikipedia) <https://en.wikipedia.org/wiki/ACID_Model>`_
atomicity
Atomicity is one of the components of the :term:`ACID` model,
:term:`ACID`
- `Atomicity (via Wikipedia) <http://en.wikipedia.org/wiki/Atomicity_(database_systems)>`_
+ `Atomicity (via Wikipedia) <https://en.wikipedia.org/wiki/Atomicity_(database_systems)>`_
consistency
Consistency is one of the components of the :term:`ACID` model,
:term:`ACID`
- `Consistency (via Wikipedia) <http://en.wikipedia.org/wiki/Consistency_(database_systems)>`_
+ `Consistency (via Wikipedia) <https://en.wikipedia.org/wiki/Consistency_(database_systems)>`_
isolation
isolated
:term:`ACID`
- `Isolation (via Wikipedia) <http://en.wikipedia.org/wiki/Isolation_(database_systems)>`_
+ `Isolation (via Wikipedia) <https://en.wikipedia.org/wiki/Isolation_(database_systems)>`_
:term:`read uncommitted`
:term:`ACID`
- `Durability (via Wikipedia) <http://en.wikipedia.org/wiki/Durability_(database_systems)>`_
+ `Durability (via Wikipedia) <https://en.wikipedia.org/wiki/Durability_(database_systems)>`_
RETURNING
This is a non-SQL standard clause provided in various forms by
:term:`primary key`
- `Candidate key (via Wikipedia) <http://en.wikipedia.org/wiki/Candidate_key>`_
+ `Candidate key (via Wikipedia) <https://en.wikipedia.org/wiki/Candidate_key>`_
https://www.databasestar.com/database-keys/
:term:`composite primary key`
- `Primary key (via Wikipedia) <http://en.wikipedia.org/wiki/Primary_Key>`_
+ `Primary key (via Wikipedia) <https://en.wikipedia.org/wiki/Primary_Key>`_
composite primary key
.. seealso::
- `Foreign Key Constraint (via Wikipedia) <http://en.wikipedia.org/wiki/Foreign_key_constraint>`_
+ `Foreign Key Constraint (via Wikipedia) <https://en.wikipedia.org/wiki/Foreign_key_constraint>`_
check constraint
.. seealso::
- `CHECK constraint (via Wikipedia) <http://en.wikipedia.org/wiki/Check_constraint>`_
+ `CHECK constraint (via Wikipedia) <https://en.wikipedia.org/wiki/Check_constraint>`_
unique constraint
unique key index
.. seealso::
- `Unique key (via Wikipedia) <http://en.wikipedia.org/wiki/Unique_key#Defining_unique_keys>`_
+ `Unique key (via Wikipedia) <https://en.wikipedia.org/wiki/Unique_key#Defining_unique_keys>`_
transient
This describes one of the major object states which
There is also a wide variety of examples involving both core SQLAlchemy
constructs as well as the ORM on the wiki. See
-`Theatrum Chemicum <http://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.
+`Theatrum Chemicum <https://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.
.. _installation:
* cPython 2.7
* cPython 3.6 and higher
-* `PyPy <http://pypy.org/>`_ 2.1 or greater
+* `PyPy <https://pypy.org/>`_ 2.1 or greater
.. versionchanged:: 1.4
Within the Python 3 series, 3.6 is now the minimum Python 3 version supported.
-------------------------------
SQLAlchemy installation is via standard Python methodologies that are
-based on `setuptools <http://pypi.python.org/pypi/setuptools/>`_, either
+based on `setuptools <https://pypi.org/project/setuptools/>`_, either
by referring to ``setup.py`` directly or by using
-`pip <http://pypi.python.org/pypi/pip/>`_ or other setuptools-compatible
+`pip <https://pypi.org/project/pip/>`_ or other setuptools-compatible
approaches.
.. versionchanged:: 1.1 setuptools is now required by the setup.py file;
pip install SQLAlchemy
This command will download the latest **released** version of SQLAlchemy from the `Python
-Cheese Shop <http://pypi.python.org/pypi/SQLAlchemy>`_ and install it to your system.
+Cheese Shop <https://pypi.org/project/SQLAlchemy>`_ and install it to your system.
In order to install the latest **prerelease** version, such as ``1.4.0b1``,
pip requires that the ``--pre`` flag be used::
False
There is a recipe for intercepting :meth:`.Session.delete` and invoking this
-expiration automatically; see `ExpireRelationshipOnFKChange <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/ExpireRelationshipOnFKChange>`_ for this. However, the usual practice of
+expiration automatically; see `ExpireRelationshipOnFKChange <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/ExpireRelationshipOnFKChange>`_ for this. However, the usual practice of
deleting items within collections is to forego the usage of
:meth:`~.Session.delete` directly, and instead use cascade behavior to
automatically invoke the deletion as a result of removing the object from the
The object is the :class:`.scoped_session` object, and it represents a
**registry** of :class:`.Session` objects. If you're not familiar with the
registry pattern, a good introduction can be found in `Patterns of Enterprise
-Architecture <http://martinfowler.com/eaaCatalog/registry.html>`_.
+Architecture <https://martinfowler.com/eaaCatalog/registry.html>`_.
.. note::
management. If you're new to SQLAlchemy, and especially if the
term "thread-local variable" seems strange to you, we recommend that
if possible you familiarize first with an off-the-shelf integration
- system such as `Flask-SQLAlchemy <http://packages.python.org/Flask-SQLAlchemy/>`_
- or `zope.sqlalchemy <http://pypi.python.org/pypi/zope.sqlalchemy>`_.
+ system such as `Flask-SQLAlchemy <https://packages.python.org/Flask-SQLAlchemy/>`_
+ or `zope.sqlalchemy <https://pypi.org/project/zope.sqlalchemy>`_.
A :class:`.scoped_session` is constructed by calling it, passing it a
**factory** which can create new :class:`.Session` objects. A factory
a handle to the same session. We call this notion **thread local storage**,
which means, a special object is used that will maintain a distinct object
per each application thread. Python provides this via the
-`threading.local() <http://docs.python.org/library/threading.html#threading.local>`_
+`threading.local() <https://docs.python.org/library/threading.html#threading.local>`_
construct. The :class:`.scoped_session` object by default uses this object
as storage, so that a single :class:`.Session` is maintained for all who call
upon the :class:`.scoped_session` registry, but only within the scope of a single
distribution. Descriptions and source code for all can be found here.
Additional SQLAlchemy examples, some user contributed, are available on the
-wiki at `<http://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.
+wiki at `<https://www.sqlalchemy.org/trac/wiki/UsageRecipes>`_.
Mapping Recipes
[<__main__.Keyword object at 0x12cdd30>, <__main__.Keyword object at 0x12cde30>]
The :class:`.AssociationProxy` object produced by the :func:`.association_proxy` function
-is an instance of a `Python descriptor <http://docs.python.org/howto/descriptor.html>`_.
+is an instance of a `Python descriptor <https://docs.python.org/howto/descriptor.html>`_.
It is always declared with the user-defined class being mapped, regardless of
whether Declarative or classical mappings via the :func:`.mapper` function are used.
for each dictionary set operation, the example fails to maintain uniqueness for
the ``Keyword`` objects on their string name, which is a typical requirement for
a tagging scenario such as this one. For this use case the recipe
-`UniqueObject <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject>`_, or
+`UniqueObject <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject>`_, or
a comparable creational strategy, is
recommended, which will apply a "lookup first, then create" strategy to the constructor
of the ``Keyword`` class, so that an already existing ``Keyword`` is returned if the
with a simple recipe-oriented approach to accomplishing this task
without any ambiguity of instrumentation - to create new subclasses, each
mapped individually. This pattern is now available as a recipe at `Entity Name
-<http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_.
+<https://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_.
.. seealso::
- `Django-style Database Routers in SQLAlchemy <http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/>`_ - blog post on a more comprehensive example of :meth:`.Session.get_bind`
+ `Django-style Database Routers in SQLAlchemy <https://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/>`_ - blog post on a more comprehensive example of :meth:`.Session.get_bind`
Horizontal Partitioning
-----------------------
:term:`isolation` - glossary explanation of isolation which includes links
to Wikipedia.
- `The SQLAlchemy Session In-Depth <http://techspot.zzzeek.org/2012/11/14/pycon-canada-the-sqlalchemy-session-in-depth/>`_ - a video + slides with an in-depth discussion of the object
+ `The SQLAlchemy Session In-Depth <https://techspot.zzzeek.org/2012/11/14/pycon-canada-the-sqlalchemy-session-in-depth/>`_ - a video + slides with an in-depth discussion of the object
lifecycle including the role of data expiration.
and is a built in function of the relational database.
* FOREIGN KEY can refer to its own table. This is referred to as a "self-referential"
foreign key.
- * Read more about foreign keys at `Foreign Key - Wikipedia <http://en.wikipedia.org/wiki/Foreign_key>`_.
+ * Read more about foreign keys at `Foreign Key - Wikipedia <https://en.wikipedia.org/wiki/Foreign_key>`_.
We'll need to create the ``addresses`` table in the database, so we will issue
another CREATE from our metadata, which will skip over tables which have
Now that we have two tables, we can show some more features of :class:`_query.Query`,
specifically how to create queries that deal with both tables at the same time.
The `Wikipedia page on SQL JOIN
-<http://en.wikipedia.org/wiki/Join_%28SQL%29>`_ offers a good introduction to
+<https://en.wikipedia.org/wiki/Join_%28SQL%29>`_ offers a good introduction to
join techniques, several of which we'll illustrate here.
To construct a simple implicit join between ``User`` and ``Address``,
.. seealso::
- `Repeatable Read Isolation Level <http://www.postgresql.org/docs/9.1/static/transaction-iso.html#XACT-REPEATABLE-READ>`_ - PostgreSQL's implementation of repeatable read, including a description of the error condition.
+ `Repeatable Read Isolation Level <https://www.postgresql.org/docs/9.1/static/transaction-iso.html#XACT-REPEATABLE-READ>`_ - PostgreSQL's implementation of repeatable read, including a description of the error condition.
Simple Version Counting
-----------------------
as well as with an UPDATE. For the UPDATE case, typically an update trigger
is needed, unless the database in question supports some other native
version identifier. The PostgreSQL database in particular supports a system
-column called `xmin <http://www.postgresql.org/docs/9.1/static/ddl-system-columns.html>`_
+column called `xmin <https://www.postgresql.org/docs/9.1/static/ddl-system-columns.html>`_
which provides UPDATE versioning. We can make use
of the PostgreSQL ``xmin`` column to version our ``User``
class as follows::
It is *strongly recommended* that server side version counters only be used
when absolutely necessary and only on backends that support :term:`RETURNING`,
e.g. PostgreSQL, Oracle, SQL Server (though SQL Server has
-`major caveats <http://blogs.msdn.com/b/sqlprogrammability/archive/2008/07/11/update-with-output-clause-triggers-and-sqlmoreresults.aspx>`_ when triggers are used), Firebird.
+`major caveats <https://blogs.msdn.com/b/sqlprogrammability/archive/2008/07/11/update-with-output-clause-triggers-and-sqlmoreresults.aspx>`_ when triggers are used), Firebird.
.. versionadded:: 0.9.0
2. What :term:`DBAPI` are we using? The Python :term:`DBAPI` is a third party
driver that SQLAlchemy uses to interact with a particular database. In
this case, we're using the name ``pysqlite``, which in modern Python
- use is the `sqlite3 <http://docs.python.org/library/sqlite3.html>`_ standard
+ use is the `sqlite3 <https://docs.python.org/library/sqlite3.html>`_ standard
library interface for SQLite. If omitted, SQLAlchemy will use a default
:term:`DBAPI` for the particular database selected.
The :viewsource:`.discriminator_on_association` and :viewsource:`.generic_fk` scripts
are modernized versions of recipes presented in the 2007 blog post
-`Polymorphic Associations with SQLAlchemy <http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/>`_.
+`Polymorphic Associations with SQLAlchemy <https://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy/>`_.
.. autosource::
primary_language = Column(String(30))
# illustrate a single-inh "conflicting" column declaration;
- # see http://docs.sqlalchemy.org/en/latest/orm/extensions/
+ # see https://docs.sqlalchemy.org/en/latest/orm/extensions/
# declarative/inheritance.html#resolving-column-conflicts
@declared_attr
def status(cls):
"""Celko's "Nested Sets" Tree Structure.
-http://www.intelligententerprise.com/001020/celko.jhtml
+https://www.intelligententerprise.com/001020/celko.jhtml
"""
This example was originally developed in the hopes that it would be
extrapolated into a comprehensive PostGIS integration layer. We are
pleased to announce that this has come to fruition as `GeoAlchemy
-<http://www.geoalchemy.org/>`_.
+<https://geoalchemy-2.readthedocs.io>`_.
The example illustrates:
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 <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_.
+`EntityName <https://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_.
.. autosource::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import util as _util
from .engine import create_engine
Copyright (C) 2005-2021 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
+the MIT License: https://www.opensource.org/licenses/mit-license.php
*/
#include <Python.h>
Copyright (C) 2010-2011 Gaetan de Menten gdementen@gmail.com
This module is part of SQLAlchemy and is released under
-the MIT License: http://www.opensource.org/licenses/mit-license.php
+the MIT License: https://www.opensource.org/licenses/mit-license.php
*/
#include <Python.h>
Copyright (C) 2010-2011 Gaetan de Menten gdementen@gmail.com
This module is part of SQLAlchemy and is released under
-the MIT License: http://www.opensource.org/licenses/mit-license.php
+the MIT License: https://www.opensource.org/licenses/mit-license.php
*/
#include <Python.h>
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
class Connector(object):
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Provide a SQLALchemy connector for the eGenix mxODBC commercial
and 2008, using the SQL Server Native driver. However, it is
possible for this to be used on other database platforms.
-For more info on mxODBC, see http://www.egenix.com/
+For more info on mxODBC, see https://www.egenix.com/
.. deprecated:: 1.4 The mxODBC DBAPI is deprecated and will be removed
in a future version. Please use one of the supported DBAPIs to
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Include imports from the sqlalchemy.dialects package for backwards
compatibility with pre 0.6 versions.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
__all__ = (
"firebird",
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from sqlalchemy.dialects.firebird.base import BIGINT
from sqlalchemy.dialects.firebird.base import BLOB
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
print(raises.fetchall())
-.. _dialects: http://mc-computing.com/Databases/Firebird/SQL_Dialect.html
+.. _dialects: https://mc-computing.com/Databases/Firebird/SQL_Dialect.html
"""
import datetime
"""Generate a ``CREATE GENERATOR`` statement for the sequence."""
# no syntax for these
- # http://www.firebirdsql.org/manual/generatorguide-sqlsyntax.html
+ # https://www.firebirdsql.org/manual/generatorguide-sqlsyntax.html
if create.element.start is not None:
raise NotImplementedError(
"Firebird SEQUENCE doesn't support START WITH"
def get_table_names(self, connection, schema=None, **kw):
# there are two queries commonly mentioned for this.
# this one, using view_blr, is at the Firebird FAQ among other places:
- # http://www.firebirdfaq.org/faq174/
+ # https://www.firebirdfaq.org/faq174/
s = """
select rdb$relation_name
from rdb$relations
# the other query is this one. It's not clear if there's really
# any difference between these two. This link:
- # http://www.alberton.info/firebird_sql_meta_info.html#.Ur3vXfZGni8
+ # https://www.alberton.info/firebird_sql_meta_info.html#.Ur3vXfZGni8
# states them as interchangeable. Some discussion at [ticket:2898]
# SELECT DISTINCT rdb$relation_name
# FROM rdb$relation_fields
@reflection.cache
def get_view_names(self, connection, schema=None, **kw):
- # see http://www.firebirdfaq.org/faq174/
+ # see https://www.firebirdfaq.org/faq174/
s = """
select rdb$relation_name
from rdb$relations
# the value comes down as "DEFAULT 'value'": there may be
# more than one whitespace around the "DEFAULT" keyword
# and it may also be lower case
- # (see also http://tracker.firebirdsql.org/browse/CORE-356)
+ # (see also https://tracker.firebirdsql.org/browse/CORE-356)
defexpr = row["fdefault"].lstrip()
assert defexpr[:8].rstrip().upper() == "DEFAULT", (
"Unrecognized default value: %s" % defexpr
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: firebird+fdb
:name: fdb
:dbapi: pyodbc
:connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...]
- :url: http://pypi.python.org/pypi/fdb/
+ :url: https://pypi.org/project/fdb/
fdb is a kinterbasdb compatible DBAPI for Firebird.
.. seealso::
- http://pythonhosted.org/fdb/usage-guide.html#retaining-transactions
+ https://pythonhosted.org/fdb/usage-guide.html#retaining-transactions
- information on the "retaining" flag.
""" # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: firebird+kinterbasdb
:name: kinterbasdb
:dbapi: kinterbasdb
:connectstring: firebird+kinterbasdb://user:password@host:port/path/to/db[?key=value&key=value...]
- :url: http://firebirdsql.org/index.php?op=devel&sub=python
+ :url: https://firebirdsql.org/index.php?op=devel&sub=python
Arguments
----------
.. seealso::
- http://sourceforge.net/projects/kinterbasdb
+ https://sourceforge.net/projects/kinterbasdb
- http://kinterbasdb.sourceforge.net/dist_docs/usage.html#adv_param_conv_dynamic_type_translation
+ https://kinterbasdb.sourceforge.net/dist_docs/usage.html#adv_param_conv_dynamic_type_translation
- http://kinterbasdb.sourceforge.net/dist_docs/usage.html#special_issue_concurrency
+ https://kinterbasdb.sourceforge.net/dist_docs/usage.html#special_issue_concurrency
""" # noqa
initialized = getattr(self.dbapi, "initialized", None)
if initialized is None:
# CVS rev 1.96 changed the name of the attribute:
- # http://kinterbasdb.cvs.sourceforge.net/viewvc/kinterbasdb/
+ # https://kinterbasdb.cvs.sourceforge.net/viewvc/kinterbasdb/
# Kinterbasdb-3.0/__init__.py?r1=1.95&r2=1.96
initialized = getattr(self.dbapi, "_initialized", False)
if not initialized:
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base # noqa
from . import mxodbc # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql
:name: Microsoft SQL Server
----------------------------------
Per
-`SQL Server 2012/2014 Documentation <http://technet.microsoft.com/en-us/library/ms187993.aspx>`_,
+`SQL Server 2012/2014 Documentation <https://technet.microsoft.com/en-us/library/ms187993.aspx>`_,
the ``NTEXT``, ``TEXT`` and ``IMAGE`` datatypes are to be removed from SQL
Server in a future release. SQLAlchemy normally relates these types to the
:class:`.UnicodeText`, :class:`_expression.TextClause` and
ALTER DATABASE MyDatabase SET READ_COMMITTED_SNAPSHOT ON
Background on SQL Server snapshot isolation is available at
-http://msdn.microsoft.com/en-us/library/ms175095.aspx.
+https://msdn.microsoft.com/en-us/library/ms175095.aspx.
""" # noqa
from ...util.langhelpers import public_factory
-# http://sqlserverbuilds.blogspot.com/
+# https://sqlserverbuilds.blogspot.com/
MS_2017_VERSION = (14,)
MS_2016_VERSION = (13,)
MS_2014_VERSION = (12,)
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from ... import cast
from ... import Column
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql+mxodbc
:name: mxODBC
:dbapi: mxodbc
:connectstring: mssql+mxodbc://<username>:<password>@<dsnname>
- :url: http://www.egenix.com/
+ :url: https://www.egenix.com/
.. deprecated:: 1.4 The mxODBC DBAPI is deprecated and will be removed
in a future version. Please use one of the supported DBAPIs to
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql+pymssql
:connectstring: mssql+pymssql://<username>:<password>@<freetds_name>/?charset=utf8
pymssql is a Python module that provides a Python DBAPI interface around
-`FreeTDS <http://www.freetds.org/>`_.
+`FreeTDS <https://www.freetds.org/>`_.
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: mssql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstring: mssql+pyodbc://<username>:<password>@<dsnname>
- :url: http://pypi.python.org/pypi/pyodbc/
+ :url: https://pypi.org/project/pyodbc/
Connecting to PyODBC
--------------------
statement.
Background on why "scope_identity()" is preferable to "@@identity":
- http://msdn.microsoft.com/en-us/library/ms190315.aspx
+ https://msdn.microsoft.com/en-us/library/ms190315.aspx
Background on why we attempt to embed "scope_identity()" into the same
statement as the INSERT:
- http://code.google.com/p/pyodbc/wiki/FAQs#How_do_I_retrieve_autogenerated/identity_values?
+ https://code.google.com/p/pyodbc/wiki/FAQs#How_do_I_retrieve_autogenerated/identity_values?
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base # noqa
from . import cymysql # noqa
# file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: mysql+aiomysql
:name: aiomysql
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. seealso::
`The utf8mb4 Character Set \
- <http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html>`_ - \
+ <https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html>`_ - \
in the MySQL documentation
.. _mysql_binary_introducer:
.. seealso::
- `CREATE INDEX <http://dev.mysql.com/doc/refman/5.0/en/create-index.html>`_ - MySQL documentation
+ `CREATE INDEX <https://dev.mysql.com/doc/refman/5.0/en/create-index.html>`_ - MySQL documentation
Index Types
~~~~~~~~~~~~~
More information can be found at:
-http://dev.mysql.com/doc/refman/5.0/en/create-index.html
+https://dev.mysql.com/doc/refman/5.0/en/create-index.html
-http://dev.mysql.com/doc/refman/5.0/en/create-table.html
+https://dev.mysql.com/doc/refman/5.0/en/create-table.html
Index Parsers
~~~~~~~~~~~~~
desired.
MySQL 5.6 introduced a new flag `explicit_defaults_for_timestamp
-<http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
+<https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
#sysvar_explicit_defaults_for_timestamp>`_ which disables the above behavior,
and in MySQL 8 this flag defaults to true, meaning in order to get a MySQL
"on update timestamp" without changing this flag, the above DDL must be
This behavior of MySQL can be changed on the MySQL side using the
`explicit_defaults_for_timestamp
-<http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
+<https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
#sysvar_explicit_defaults_for_timestamp>`_ configuration flag introduced in
MySQL 5.6. With this server setting enabled, TIMESTAMP columns behave like
any other datatype on the MySQL side with regards to defaults and nullability.
elif offset_clause is not None:
# As suggested by the MySQL docs, need to apply an
# artificial limit if one wasn't provided
- # http://dev.mysql.com/doc/refman/5.0/en/select.html
+ # https://dev.mysql.com/doc/refman/5.0/en/select.html
if limit_clause is None:
# hardwire the upper limit. Currently
# needed by OurSQL with Python 3
if not column.nullable:
colspec.append("NOT NULL")
- # see: http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql_timestamp_null # noqa
+ # see: https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql_timestamp_null # noqa
elif column.nullable and is_timestamp:
colspec.append("NULL")
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: mysql+cymysql
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: mysql+mysqlconnector
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
-------------
The mysqlclient DBAPI is a maintained fork of the
-`MySQL-Python <http://sourceforge.net/projects/mysql-python>`_ DBAPI
+`MySQL-Python <https://sourceforge.net/projects/mysql-python>`_ DBAPI
that is no longer maintained. `mysqlclient`_ supports Python 2 and Python 3
and is very stable.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
:name: OurSQL
:dbapi: oursql
:connectstring: mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname>
- :url: http://packages.python.org/oursql/
+ :url: https://packages.python.org/oursql/
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
:name: PyODBC
:dbapi: pyodbc
:connectstring: mysql+pyodbc://<username>:<password>@<dsnname>
- :url: http://pypi.python.org/pypi/pyodbc/
+ :url: https://pypi.org/project/pyodbc/
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import datetime
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base # noqa
from . import cx_oracle # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: oracle
Oracle doesn't have native ON UPDATE CASCADE functionality. A trigger based
solution is available at
-http://asktom.oracle.com/tkyte/update_cascade/index.html .
+https://asktom.oracle.com/tkyte/update_cascade/index.html .
When using the SQLAlchemy ORM, the ORM has limited ability to manually issue
cascading updates - specify ForeignKey objects using the
# oracle has no ON UPDATE CASCADE -
# its only available via triggers
- # http://asktom.oracle.com/tkyte/update_cascade/index.html
+ # https://asktom.oracle.com/tkyte/update_cascade/index.html
if constraint.onupdate is not None:
util.warn(
"Oracle does not contain native UPDATE CASCADE "
if dblink:
# using user_db_links here since all_db_links appears
# to have more restricted permissions.
- # http://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_admin005.htm
+ # https://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_admin005.htm
# will need to hear from more users if we are doing
# the right thing here. See [ticket:2619]
owner = connection.scalar(
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: oracle+cx_oracle
Users of the cx_Oracle dialect are **strongly encouraged** to read through
cx_Oracle's list of built-in datatype symbols at
-http://cx-oracle.readthedocs.io/en/latest/module.html#database-types.
+https://cx-oracle.readthedocs.io/en/latest/api_manual/module.html#database-types.
Note that in some cases, significant performance degradation can occur when
using these types vs. not, in particular when specifying ``cx_Oracle.CLOB``.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base
from . import pg8000 # noqa
from . import psycopg2 # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql+asyncpg
:name: asyncpg
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql
is represented in those remote tables, in the case where that remote
schema name is also a member of the current
`PostgreSQL search path
-<http://www.postgresql.org/docs/current/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_.
+<https://www.postgresql.org/docs/current/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_.
By default, the PostgreSQL dialect mimics the behavior encouraged by
PostgreSQL's own ``pg_get_constraintdef()`` builtin procedure. This function
.. seealso::
`The Schema Search Path
- <http://www.postgresql.org/docs/9.0/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_
+ <https://www.postgresql.org/docs/9.0/static/ddl-schemas.html#DDL-SCHEMAS-PATH>`_
- on the PostgreSQL website.
INSERT/UPDATE...RETURNING
.. seealso::
`INSERT .. ON CONFLICT
- <http://www.postgresql.org/docs/current/static/sql-insert.html#SQL-ON-CONFLICT>`_
+ <https://www.postgresql.org/docs/current/static/sql-insert.html#SQL-ON-CONFLICT>`_
- in the PostgreSQL documentation.
Specifying the Target
PostgreSQL allows the specification of an *operator class* for each column of
an index (see
-http://www.postgresql.org/docs/8.3/interactive/indexes-opclass.html).
+https://www.postgresql.org/docs/8.3/interactive/indexes-opclass.html).
The :class:`.Index` construct allows these to be specified via the
``postgresql_ops`` keyword argument::
PostgreSQL provides several index types: B-Tree, Hash, GiST, and GIN, as well
as the ability for users to create their own (see
-http://www.postgresql.org/docs/8.3/static/indexes-types.html). These can be
+https://www.postgresql.org/docs/8.3/static/indexes-types.html). These can be
specified on :class:`.Index` using the ``postgresql_using`` keyword argument::
Index('my_index', my_table.c.data, postgresql_using='gin')
.. seealso::
`PostgreSQL CREATE TABLE options
- <http://www.postgresql.org/docs/current/static/sql-createtable.html>`_
+ <https://www.postgresql.org/docs/current/static/sql-createtable.html>`_
.. _postgresql_table_valued_overview:
# psycopg2, others may have placed ENUM here as well
self.colspecs.pop(ENUM, None)
- # http://www.postgresql.org/docs/9.3/static/release-9-2.html#AEN116689
+ # https://www.postgresql.org/docs/9.3/static/release-9-2.html#AEN116689
self.supports_smallserial = self.server_version_info >= (9, 2)
if self.server_version_info < (8, 2):
n.oid = c.relnamespace
ORDER BY 1
"""
- # http://www.postgresql.org/docs/9.0/static/sql-createtable.html
+ # https://www.postgresql.org/docs/9.0/static/sql-createtable.html
FK_REGEX = re.compile(
r"FOREIGN KEY \((.*?)\) REFERENCES (?:(.*?)\.)?(.*?)\((.*?)\)"
r"[\s]?(MATCH (FULL|PARTIAL|SIMPLE)+)?"
def _pg_index_any(self, col, compare_to):
if self.server_version_info < (8, 1):
- # http://www.postgresql.org/message-id/10279.1124395722@sss.pgh.pa.us
+ # https://www.postgresql.org/message-id/10279.1124395722@sss.pgh.pa.us
# "In CVS tip you could replace this with "attnum = ANY (indkey)".
# Unfortunately, most array support doesn't work on int2vector in
# pre-8.1 releases, so I think you're kinda stuck with the above
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import ext
from ... import util
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .array import ARRAY
from ... import util
Defines an EXCLUDE constraint as described in the `PostgreSQL
documentation`__.
- __ http://www.postgresql.org/docs/9.0/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE
+ __ https://www.postgresql.org/docs/9.0/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE
""" # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from ... import types as sqltypes
# file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql+pg8000
:name: pg8000
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg2
:connectstring: postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...]
- :url: http://pypi.python.org/pypi/psycopg2/
+ :url: https://pypi.org/project/psycopg2/
psycopg2 Connect Arguments
--------------------------
.. seealso::
`PQconnectdbParams \
- <http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_
+ <https://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_
.. _psycopg2_multi_host:
Modern versions of psycopg2 include a feature known as
`Fast Execution Helpers \
-<http://initd.org/psycopg/docs/extras.html#fast-execution-helpers>`_, which
+<https://initd.org/psycopg/docs/extras.html#fast-execution-helpers>`_, which
have been shown in benchmarking to improve psycopg2's executemany()
performance, primarily with INSERT statements, by multiple orders of magnitude.
SQLAlchemy internally makes use of these extensions for ``executemany()`` style
def create_server_side_cursor(self):
# use server-side cursors:
- # http://lists.initd.org/pipermail/psycopg/2007-January/005251.html
+ # https://lists.initd.org/pipermail/psycopg/2007-January/005251.html
ident = "c_%s_%s" % (hex(id(self))[2:], hex(_server_side_id())[2:])
return self._dbapi_connection.cursor(ident)
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: postgresql+psycopg2cffi
:name: psycopg2cffi
:dbapi: psycopg2cffi
:connectstring: postgresql+psycopg2cffi://user:password@host:port/dbname[?key=value&key=value...]
- :url: http://pypi.python.org/pypi/psycopg2cffi/
+ :url: https://pypi.org/project/psycopg2cffi/
``psycopg2cffi`` is an adaptation of ``psycopg2``, using CFFI for the C
layer. This makes it suitable for use in e.g. PyPy. Documentation
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+pygresql
:name: pygresql
:dbapi: pgdb
:connectstring: postgresql+pygresql://user:password@host:port/dbname[?key=value&key=value...]
- :url: http://www.pygresql.org/
+ :url: https://www.pygresql.org/
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: postgresql+pypostgresql
:name: py-postgresql
:dbapi: pypostgresql
:connectstring: postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]
- :url: http://python.projects.pgfoundry.org/
+ :url: https://python.projects.pgfoundry.org/
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from ... import types as sqltypes
provided in the ``postgres`` dialect and can likely be used for
any range types you create yourself.
- __ http://www.postgresql.org/docs/devel/static/functions-range.html
+ __ https://www.postgresql.org/docs/devel/static/functions-range.html
No extra support is provided for the Range Functions listed in
Table 9-45 of the PostgreSQL documentation. For these, the normal
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base # noqa
from . import pysqlcipher # noqa
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: sqlite
.. seealso::
- `Type Affinity <http://www.sqlite.org/datatype3.html#affinity>`_ -
+ `Type Affinity <https://www.sqlite.org/datatype3.html#affinity>`_ -
in the SQLite documentation
.. _sqlite_autoincrement:
SQLite Auto Incrementing Behavior
----------------------------------
-Background on SQLite's autoincrement is at: http://sqlite.org/autoinc.html
+Background on SQLite's autoincrement is at: https://sqlite.org/autoinc.html
Key concepts:
:ref:`sqlalchemy.ext.compiler_toplevel`
- `Datatypes In SQLite Version 3 <http://sqlite.org/datatype3.html>`_
+ `Datatypes In SQLite Version 3 <https://sqlite.org/datatype3.html>`_
.. _sqlite_concurrency:
For more information on SQLite's lack of write concurrency by design, please
see
`Situations Where Another RDBMS May Work Better - High Concurrency
-<http://www.sqlite.org/whentouse.html>`_ near the bottom of the page.
+<https://www.sqlite.org/whentouse.html>`_ near the bottom of the page.
The following subsections introduce areas that are impacted by SQLite's
file-based architecture and additionally will usually require workarounds to
SQLite supports "transaction isolation" in a non-standard way, along two
axes. One is that of the
-`PRAGMA read_uncommitted <http://www.sqlite.org/pragma.html#pragma_read_uncommitted>`_
+`PRAGMA read_uncommitted <https://www.sqlite.org/pragma.html#pragma_read_uncommitted>`_
instruction. This setting can essentially switch SQLite between its
default mode of ``SERIALIZABLE`` isolation, and a "dirty read" isolation
mode normally referred to as ``READ UNCOMMITTED``.
The other axis along which SQLite's transactional locking is impacted is
via the nature of the ``BEGIN`` statement used. The three varieties
are "deferred", "immediate", and "exclusive", as described at
-`BEGIN TRANSACTION <http://sqlite.org/lang_transaction.html>`_. A straight
+`BEGIN TRANSACTION <https://sqlite.org/lang_transaction.html>`_. A straight
``BEGIN`` statement uses the "deferred" mode, where the database file is
not locked until the first read or write operation, and read access remains
open to other transactions until the first write operation. But again,
.. seealso::
- `SQLite Foreign Key Support <http://www.sqlite.org/foreignkeys.html>`_
+ `SQLite Foreign Key Support <https://www.sqlite.org/foreignkeys.html>`_
- on the SQLite web site.
:ref:`event_toplevel` - SQLAlchemy event API.
other dialects. However, the SQLite dialect has a different "fallback"
routine for when a particular type name is not located in the lookup map;
it instead implements the SQLite "type affinity" scheme located at
-http://www.sqlite.org/datatype3.html section 2.1.
+https://www.sqlite.org/datatype3.html section 2.1.
The provided typemap will make direct associations from an exact string
name match for the following types:
)
self.supports_cast = self.dbapi.sqlite_version_info >= (3, 2, 3)
self.supports_multivalues_insert = (
- # http://www.sqlite.org/releaselog/3_7_11.html
+ # https://www.sqlite.org/releaselog/3_7_11.html
self.dbapi.sqlite_version_info
>= (3, 7, 11)
)
- # see http://www.sqlalchemy.org/trac/ticket/2568
- # as well as http://www.sqlite.org/src/info/600482d161
+ # see https://www.sqlalchemy.org/trac/ticket/2568
+ # as well as https://www.sqlite.org/src/info/600482d161
self._broken_fk_pragma_quotes = self.dbapi.sqlite_version_info < (
3,
6,
if res:
value = res[0]
else:
- # http://www.sqlite.org/changes.html#version_3_3_3
+ # https://www.sqlite.org/changes.html#version_3_3_3
# "Optional READ UNCOMMITTED isolation (instead of the
# default isolation level of SERIALIZABLE) and
# table level locking when database connections
Internally, SQLite handles this with a 'data type affinity' for each
column definition, mapping to one of 'TEXT', 'NUMERIC', 'INTEGER',
'REAL', or 'NONE' (raw bits). The algorithm that determines this is
- listed in http://www.sqlite.org/datatype3.html section 2.1.
+ listed in https://www.sqlite.org/datatype3.html section 2.1.
This method allows SQLAlchemy to support that algorithm, while still
providing access to smarter reflection utilities by recognizing
include_auto_indexes = kw.pop("include_auto_indexes", False)
for row in pragma_indexes:
# ignore implicit primary key index.
- # http://www.mail-archive.com/sqlite-users@sqlite.org/msg30517.html
+ # https://www.mail-archive.com/sqlite-users@sqlite.org/msg30517.html
if not include_auto_indexes and row[1].startswith(
"sqlite_autoindex"
):
if not cursor._soft_closed:
# work around SQLite issue whereby cursor.description
# is blank when PRAGMA returns no rows:
- # http://www.sqlite.org/cvstrac/tktview?tn=1884
+ # https://www.sqlite.org/cvstrac/tktview?tn=1884
result = cursor.fetchall()
else:
result = []
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from ... import util
from ...sql import coercions
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sqlite+pysqlcipher
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: sqlite+pysqlite
:name: pysqlite
:dbapi: sqlite3
:connectstring: sqlite+pysqlite:///file_path
- :url: http://docs.python.org/library/sqlite3.html
+ :url: https://docs.python.org/library/sqlite3.html
Note that ``pysqlite`` is the same driver as the ``sqlite3``
module included with the Python distribution.
When we take control of ``"BEGIN"``, we can also control directly SQLite's
locking modes, introduced at
-`BEGIN TRANSACTION <http://sqlite.org/lang_transaction.html>`_,
+`BEGIN TRANSACTION <https://sqlite.org/lang_transaction.html>`_,
by adding the desired locking mode to our ``"BEGIN"``::
@event.listens_for(engine, "begin")
.. seealso::
- `BEGIN TRANSACTION <http://sqlite.org/lang_transaction.html>`_ -
+ `BEGIN TRANSACTION <https://sqlite.org/lang_transaction.html>`_ -
on the SQLite site
- `sqlite3 SELECT does not BEGIN a transaction <http://bugs.python.org/issue9924>`_ -
+ `sqlite3 SELECT does not BEGIN a transaction <https://bugs.python.org/issue9924>`_ -
on the Python bug tracker
- `sqlite3 module breaks transactions and potentially corrupts data <http://bugs.python.org/issue10740>`_ -
+ `sqlite3 module breaks transactions and potentially corrupts data <https://bugs.python.org/issue10740>`_ -
on the Python bug tracker
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base # noqa
from . import pyodbc # noqa
# <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
-# AG http://www.fam.ch, with coding by Alexander Houben
+# AG https://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sybase+mxodbc
:name: mxODBC
:dbapi: mxodbc
:connectstring: sybase+mxodbc://<username>:<password>@<dsnname>
- :url: http://www.egenix.com/
+ :url: https://www.egenix.com/
.. note::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sybase+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstring: sybase+pyodbc://<username>:<password>@<dsnname>[/<database>]
- :url: http://pypi.python.org/pypi/pyodbc/
+ :url: https://pypi.org/project/pyodbc/
Unicode Support
---------------
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sybase+pysybase
:name: Python-Sybase
:dbapi: Sybase
:connectstring: sybase+pysybase://<username>:<password>@<dsn>/[database name]
- :url: http://python-sybase.sourceforge.net/
+ :url: https://python-sybase.sourceforge.net/
Unicode Support
---------------
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import with_statement
import contextlib
Note above, the usage of a question mark "?" or other
symbol is contingent upon the "paramstyle" accepted by the DBAPI
in use, which may be any of "qmark", "named", "pyformat", "format",
- "numeric". See `pep-249 <http://www.python.org/dev/peps/pep-0249/>`_
- for details on paramstyle.
+ "numeric". See `pep-249
+ <https://www.python.org/dev/peps/pep-0249/>`_ for details on
+ paramstyle.
To execute a textual SQL statement which uses bound parameters in a
DBAPI-agnostic way, use the :func:`_expression.text` construct.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import base
be used instead. Can be used for testing of DBAPIs as well as to
inject "mock" DBAPI implementations into the :class:`_engine.Engine`.
- :param paramstyle=None: The `paramstyle <http://legacy.python.org/dev/peps/pep-0249/#paramstyle>`_
+ :param paramstyle=None: The `paramstyle <https://legacy.python.org/dev/peps/pep-0249/#paramstyle>`_
to use when rendering bound parameters. This style defaults to the
one recommended by the DBAPI itself, which is retrieved from the
``.paramstyle`` attribute of the DBAPI. However, most DBAPIs accept
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define cursor-specific result set constructs including
:class:`.BaseCursorResult`, :class:`.CursorResult`."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Default implementations of per-dialect sqlalchemy.engine classes.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .base import Engine
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define core interfaces used by the engine system."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from operator import attrgetter
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Provides an abstraction for obtaining database schema information.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define generic result set constructs."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define row constructs including :class:`.Row`."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Deprecated mock engine strategy used by Alembic.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
information about a database connection specification.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .. import exc
from .. import util
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .api import CANCEL
from .api import contains
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Public API functions for the event system.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Attribute implementation for _Dispatch classes.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Base implementation classes.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Routines to handle adaption of legacy call signatures,
generation of deprecation notes and docstrings.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Core event interfaces."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Exceptions used with SQLAlchemy.
else:
return (
"(Background on this error at: "
- "http://sqlalche.me/e/%s/%s)"
+ "https://sqlalche.me/e/%s/%s)"
% (
_version_token,
self.code,
def __str__(self):
return (
super(RemovedIn20Warning, self).__str__()
- + " (Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9)"
+ + " (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)"
)
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .. import util as _sa_util
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
elif len(a) == 1:
seq_or_map = a[0]
# discern dict from sequence - took the advice from
- # http://www.voidspace.org.uk/python/articles/duck_typing.shtml
+ # https://www.voidspace.org.uk/python/articles/duck_typing.shtml
# still not perfect :(
if hasattr(seq_or_map, "keys"):
for item in seq_or_map:
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .engine import AsyncConnection
from .engine import AsyncEngine
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import exc as async_exc
from .base import ProxyComparable
from .base import StartableContext
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .engine import AsyncConnectable
from .session import AsyncSession
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from ... import exc
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import operator
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .session import AsyncSession
from ...orm.scoping import ScopedSessionMixin
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import engine
from . import result as _result
from .base import ReversibleProxy
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""Define an extension to the :mod:`sqlalchemy.ext.declarative` system
which automatically generates mapped classes and relationships from a database
and :func:`.name_for_collection_relationship`. Any or all of these
functions are provided as in the example below, where we use a "camel case"
scheme for class names and a "pluralizer" for collection names using the
-`Inflect <https://pypi.python.org/pypi/inflect>`_ package::
+`Inflect <https://pypi.org/project/inflect>`_ package::
import re
import inflect
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Baked query extension.
Provides a creational pattern for the :class:`.query.Query` object which
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""Provides an API for creation of custom ClauseElements and compilers.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .extensions import AbstractConcreteBase
from .extensions import ConcreteBase
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Public API functions and helpers for declarative."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Horizontal sharding support.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""Define attributes on ORM-mapped classes that have "hybrid" behavior.
.. seealso::
`Hybrids and Value Agnostic Types
- <http://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/>`_
+ <https://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/>`_
- on the techspot.zzzeek.org blog
`Value Agnostic Types, Part II
- <http://techspot.zzzeek.org/2011/10/29/value-agnostic-types-part-ii/>`_ -
+ <https://techspot.zzzeek.org/2011/10/29/value-agnostic-types-part-ii/>`_ -
on the techspot.zzzeek.org blog
.. _hybrid_transformers:
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define attributes on ORM-mapped classes that have "index" attributes for
columns with :class:`_types.Indexable` types.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""Provide support for tracking of in-place changes to scalar values,
which are propagated into ORM change events on owning parent objects.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import Optional
from typing import Union
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import Optional
from typing import Union
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import Optional
from typing import Sequence
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import Dict
from typing import List
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Mypy plugin for SQLAlchemy ORM.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""A custom list that manages index/position information for contained
elements.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Serializer/Deserializer objects for usage with SQLAlchemy query structures,
allowing "contextual" deserialization.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Future 2.0 API features.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Future 2.0 API features for Orm.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The inspection module provides the :func:`_sa.inspect` function,
which delivers runtime information about a wide variety
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Logging control and utilities.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Functional constructs for ORM configuration.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation for class attributes and their interaction
with instances.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Constants and rudimental functions used throughout the ORM.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Routines to handle the string class registry used by declarative.
This system allows specification of classes and expressions used in
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Support for collections of mapped entities.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import attributes
from . import interfaces
from . import loading
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Public API functions and helpers for declarative."""
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Internal implementation for declarative."""
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Relationship dependencies.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Descriptor properties are more "auxiliary" properties
that exist as configurational elements, but don't participate
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Dynamic collection API.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import operator
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""ORM event interfaces.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""SQLAlchemy ORM exceptions."""
from .. import exc as sa_exc
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import weakref
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Defines SQLAlchemy's system of class instrumentation.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to convert database
rows into object instances and associated state.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Logic to map Python classes to and from selectables.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Path tracking utilities, representing mapper graph traversals.
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to emit INSERT, UPDATE
and DELETE statements on behalf of a :class:`_orm.Mapper` and its descending
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""MapperProperty implementations.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The Query class and support.
Here is the `PostgreSQL WITH
RECURSIVE example
- <http://www.postgresql.org/docs/8.4/static/queries-with.html>`_.
+ <https://www.postgresql.org/docs/8.4/static/queries-with.html>`_.
Note that, in this example, the ``included_parts`` cte and the
``incl_alias`` alias of it are Core selectables, which
means the columns are accessed via the ``.c.`` attribute. The
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`_orm.relationship`.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import class_mapper
from . import exc as orm_exc
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Provides the Session class and related utilities."""
the connections are no longer safe to be used.
Below illustrates a scenario when using `gevent
- <http://www.gevent.org/>`_, which can produce ``Timeout`` exceptions
+ <https://www.gevent.org/>`_, which can produce ``Timeout`` exceptions
that may mean the underlying connection should be discarded::
import gevent
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation of instances.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related MapperOptions."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""private module containing functions used for copying data
between instances based on join conditions.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The internals for the unit of work system.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Base constructs for connection pools.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""DBAPI proxy utility.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .base import Pool
from .. import event
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Pool implementation classes.
# Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""defines generic type conversion functions, as used in bind and result
processors.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Compatibility namespace for sqlalchemy.sql.schema and related.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .base import Executable
from .compiler import COLLECT_CARTESIAN_PRODUCTS
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
copies of SQL constructs which contain context-specific markers and
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Foundational utilities common to many sql modules.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import numbers
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Base SQL and DDL compiler implementations.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Functions used by compiler.py to determine the parameters rendered
within INSERT and UPDATE statements.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them for a create/drop call.
# traverse client side defaults which may refer to server-side
# sequences. noting that some of these client side defaults may also be
- # set up as server side defaults (see http://docs.sqlalchemy.org/en/
+ # set up as server side defaults (see https://docs.sqlalchemy.org/en/
# latest/core/defaults.html#associating-a-sequence-as-the-server-side-
# default), so have to be dropped after the table is dropped.
for column in table.columns:
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Default implementation of SQL comparison operations.
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Provide :class:`_expression.Insert`, :class:`_expression.Update` and
:class:`_expression.Delete`.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Core SQL expression elements, including :class:`_expression.ClauseElement`,
:class:`_expression.ColumnElement`, and derived classes.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .base import SchemaEventTarget
from .. import event
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Defines the public namespace for SQL expression constructs.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""SQL function API, factories, and built-in functions.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import itertools
import operator
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Establish constraint and index naming conventions.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Defines operators used in SQL expressions."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from .. import util
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The schema module provides the building blocks for database metadata.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""The :class:`_expression.FromClause` class of SQL expression elements,
representing
from those already selected.
The following examples include two from PostgreSQL's documentation at
- http://www.postgresql.org/docs/current/static/queries-with.html,
+ https://www.postgresql.org/docs/current/static/queries-with.html,
as well as additional examples.
Example 1, non recursive::
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""SQL specific types.
The Python ``decimal.Decimal`` class is generally slow
performing; cPython 3.3 has now switched to use the `cdecimal
- <http://pypi.python.org/pypi/cdecimal/>`_ library natively. For
+ <https://pypi.org/project/cdecimal/>`_ library natively. For
older Python versions, the ``cdecimal`` library can be patched
into any application where it will replace the ``decimal``
library fully, however this needs to be applied globally and
@util.memoized_property
def _expression_adaptations(self):
- # Based on http://www.postgresql.org/docs/current/\
+ # Based on https://www.postgresql.org/docs/current/\
# static/functions-datetime.html.
return {
@util.memoized_property
def _expression_adaptations(self):
- # Based on http://www.postgresql.org/docs/current/\
+ # Based on https://www.postgresql.org/docs/current/\
# static/functions-datetime.html.
return {
@util.memoized_property
def _expression_adaptations(self):
- # Based on http://www.postgresql.org/docs/current/\
+ # Based on https://www.postgresql.org/docs/current/\
# static/functions-datetime.html.
return {
class _AbstractInterval(_LookupExpressionAdapter, TypeEngine):
@util.memoized_property
def _expression_adaptations(self):
- # Based on http://www.postgresql.org/docs/current/\
+ # Based on https://www.postgresql.org/docs/current/\
# static/functions-datetime.html.
return {
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Base types API.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""High level utilities which build upon other modules here.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
Examples of how the visit system is used can be seen in the source code
of for example the ``sqlalchemy.sql.util`` and the ``sqlalchemy.sql.compiler``
modules. Some background on clause adaption is also at
-http://techspot.zzzeek.org/2008/01/23/expression-transformations/ .
+https://techspot.zzzeek.org/2008/01/23/expression-transformations/ .
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from . import config
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import collections
import contextlib
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
# functions and wrappers to run tests, fixtures, provisioning and
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import collections
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import sqlalchemy as sa
from .. import exc as sa_exc
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import contextlib
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import contextlib
import re
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Import stub for mock library.
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Classes used in pickling tests, need to be at the module level for
unpickling.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Testing extensions.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Profiling support for unit and performance tests.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Global database feature support policy.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import sys
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
import decimal
import gc
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Compatibility namespace for sqlalchemy.sql.types.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
from collections import defaultdict
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Collection classes and helpers."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""supplies the "preloaded" registry to resolve circular module imports at
runtime.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Handle Python version/platform incompatibilities."""
Drops the middle class upon creation.
- Source: http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
+ Source: https://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
"""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Helpers related to deprecation of functions, methods, classes, other
functionality."""
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, classes, hierarchies, attributes, functions, and methods.
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""An adaptation of Py2.3/2.4's Queue module which supports reentrant
behavior, using RLock instead of Lock for its mutex object. The
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
+# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Topological sorting algorithms."""
def find_cycles(tuples, allitems):
# adapted from:
- # http://neopythonic.blogspot.com/2009/01/detecting-cycles-in-directed-graph.html
+ # https://neopythonic.blogspot.com/2009/01/detecting-cycles-in-directed-graph.html
edges = util.defaultdict(set)
for parent, child in tuples:
description = Database Abstraction Library
long_description = file: README.rst
long_description_content_type = text/x-rst
-url = http://www.sqlalchemy.org
+url = https://www.sqlalchemy.org
author = Mike Bayer
author_email = mike_mp@zzzcomputing.com
license = MIT
# fails on newer versions of pysqlite due to unusual memory behavior
# in pysqlite itself. background at:
- # http://thread.gmane.org/gmane.comp.python.db.pysqlite.user/2290
+ # https://thread.gmane.org/gmane.comp.python.db.pysqlite.user/2290
@testing.crashes("mysql+cymysql", "blocking")
def test_join_cache_deprecated_coercion(self):
str(exc),
"(test.base.test_except.OperationalError) \n"
"[SQL: this is a message]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
"(test.base.test_except.OperationalError) \n"
"[SQL: this is a message\nthis is the next line\n"
"the last line]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
"(sqlalchemy.exc.InvalidRequestError) hello\n"
"[SQL: select * from table]\n"
"[parameters: [{'x': 1}]]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/abcd)"
+ "(Background on this error at: https://sqlalche.me/e/%s/abcd)"
% sa_exceptions._version_token,
)
eq_(err.args, ("(sqlalchemy.exc.InvalidRequestError) hello",))
eq_(
str(orig),
"(2006, 'Test raise operational error')\n"
- "(Background on this error at: http://sqlalche.me/e/%s/dbapi)"
+ "(Background on this error at: https://sqlalche.me/e/%s/dbapi)"
% sa_exceptions._version_token,
)
compat.text_type(orig),
compat.u(
"méil\n(Background on this error at: "
- "http://sqlalche.me/e/%s/dbapi)" % sa_exceptions._version_token
+ "https://sqlalche.me/e/%s/dbapi)"
+ % sa_exceptions._version_token
),
)
eq_(orig.args, (u("méil"),))
"[SQL: this is a message]\n"
"[parameters: [{1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1},"
" {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}]]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
eq_(
"{1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}, "
"{1: 1}, {1: 1} ... displaying 10 of 11 total "
"bound parameter sets ... {1: 1}, {1: 1}]]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
try:
"[SQL: this is a message]\n"
"[parameters: [(1,), "
"(1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,), (1,)]]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
try:
"(1,), (1,), (1,), (1,), (1,), (1,), (1,) "
"... displaying 10 of 11 total bound "
"parameter sets ... (1,), (1,)]]\n"
- "(Background on this error at: http://sqlalche.me/e/%s/e3q8)"
+ "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
% sa_exceptions._version_token,
)
__backend__ = True
# fixed in mysql-connector as of 2.0.1,
- # see http://bugs.mysql.com/bug.php?id=73266
+ # see https://bugs.mysql.com/bug.php?id=73266
def test_precision_float_roundtrip(self, metadata, connection):
t = Table(
"t",
# TIMESTAMP without NULL inserts current time when passed
# NULL. when not passed, generates 0000-00-00 quite
# annoyingly.
- # the flag http://dev.mysql.com/doc/refman/5.6/en/\
+ # the flag https://dev.mysql.com/doc/refman/5.6/en/\
# server-system-variables.html#sysvar_explicit_defaults_for_timestamp
# changes this for 5.6 if set.
that start and end with quotes.
SQLite claims to have fixed this in
- http://www.sqlite.org/src/info/600482d161, however
+ https://www.sqlite.org/src/info/600482d161, however
it still fails if the FK points to a table name that actually
has quotes as part of its name.
"""tests against hybrids that return a non-ClauseElement.
use cases derived from the example at
- http://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/
+ https://techspot.zzzeek.org/2011/10/21/hybrids-and-value-agnostic-types/
"""
'"Address" object is being merged into a Session along '
'the backref cascade path for relationship "User.addresses"'
# link added to this specific warning
- r".*Background on this error at: http://sqlalche.me/e/14/s9r1"
+ r".*Background on this error at: "
+ r"https://sqlalche.me/e/14/s9r1"
# link added to all RemovedIn20Warnings
- r".*Background on SQLAlchemy 2.0 at: http://sqlalche.me/e/b8d9"
+ r".*Background on SQLAlchemy 2.0 at: "
+ r"https://sqlalche.me/e/b8d9"
):
a1.user = u1
sess.add(a1)
class PendingOrphanTestTwoLevel(fixtures.MappedTest):
"""test usages stated at
- http://article.gmane.org/gmane.comp.python.sqlalchemy.user/3085
- http://article.gmane.org/gmane.comp.python.sqlalchemy.user/3119
+ https://article.gmane.org/gmane.comp.python.sqlalchemy.user/3085
+ https://article.gmane.org/gmane.comp.python.sqlalchemy.user/3119
"""
@classmethod
"""test saving a null composite value
See google groups thread for more context:
- http://groups.google.com/group/sqlalchemy/browse_thread/thread/0c6580a1761b2c29
+ https://groups.google.com/group/sqlalchemy/browse_thread/thread/0c6580a1761b2c29
"""