diff options
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mssql/__init__.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/dml.py | 67 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2.py | 14 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/session.py | 20 | ||||
| -rw-r--r-- | lib/sqlalchemy/pool.py | 3 |
6 files changed, 57 insertions, 55 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/__init__.py b/lib/sqlalchemy/dialects/mssql/__init__.py index 7cd5c32bc..27670ae32 100644 --- a/lib/sqlalchemy/dialects/mssql/__init__.py +++ b/lib/sqlalchemy/dialects/mssql/__init__.py @@ -15,7 +15,7 @@ from sqlalchemy.dialects.mssql.base import \ NCHAR, TEXT, NTEXT, DECIMAL, NUMERIC, FLOAT, DATETIME,\ DATETIME2, DATETIMEOFFSET, DATE, TIME, SMALLDATETIME, \ BINARY, VARBINARY, BIT, REAL, IMAGE, TIMESTAMP, ROWVERSION, \ - MONEY, SMALLMONEY, UNIQUEIDENTIFIER, SQL_VARIANT, dialect + MONEY, SMALLMONEY, UNIQUEIDENTIFIER, SQL_VARIANT, XML, dialect __all__ = ( @@ -23,5 +23,5 @@ __all__ = ( 'NCHAR', 'TEXT', 'NTEXT', 'DECIMAL', 'NUMERIC', 'FLOAT', 'DATETIME', 'DATETIME2', 'DATETIMEOFFSET', 'DATE', 'TIME', 'SMALLDATETIME', 'BINARY', 'VARBINARY', 'BIT', 'REAL', 'IMAGE', 'TIMESTAMP', 'ROWVERSION', - 'MONEY', 'SMALLMONEY', 'UNIQUEIDENTIFIER', 'SQL_VARIANT', 'dialect' + 'MONEY', 'SMALLMONEY', 'UNIQUEIDENTIFIER', 'SQL_VARIANT', 'XML', 'dialect' ) diff --git a/lib/sqlalchemy/dialects/postgresql/dml.py b/lib/sqlalchemy/dialects/postgresql/dml.py index bfdfbfa36..503e29024 100644 --- a/lib/sqlalchemy/dialects/postgresql/dml.py +++ b/lib/sqlalchemy/dialects/postgresql/dml.py @@ -54,40 +54,41 @@ class Insert(StandardInsert): required, but only one of these can be specified. :param constraint: - The name of a unique or exclusion constraint on the table, - or the constraint object itself if it has a .name attribute. + The name of a unique or exclusion constraint on the table, + or the constraint object itself if it has a .name attribute. :param index_elements: - A sequence consisting of string column names, :class:`.Column` - objects, or other column expression objects that will be used - to infer a target index. + A sequence consisting of string column names, :class:`.Column` + objects, or other column expression objects that will be used + to infer a target index. :param index_where: - Additional WHERE criterion that can be used to infer a - conditional target index. + Additional WHERE criterion that can be used to infer a + conditional target index. :param set_: - Required argument. A dictionary or other mapping object - with column names as keys and expressions or literals as values, - specifying the ``SET`` actions to take. - If the target :class:`.Column` specifies a ".key" attribute distinct - from the column name, that key should be used. - - .. warning:: This dictionary does **not** take into account - Python-specified default UPDATE values or generation functions, - e.g. those specified using :paramref:`.Column.onupdate`. - These values will not be exercised for an ON CONFLICT style of - UPDATE, unless they are manually specified in the - :paramref:`.Insert.on_conflict_do_update.set_` dictionary. + Required argument. A dictionary or other mapping object + with column names as keys and expressions or literals as values, + specifying the ``SET`` actions to take. + If the target :class:`.Column` specifies a ".key" attribute distinct + from the column name, that key should be used. + + .. warning:: This dictionary does **not** take into account + Python-specified default UPDATE values or generation functions, + e.g. those specified using :paramref:`.Column.onupdate`. + These values will not be exercised for an ON CONFLICT style of + UPDATE, unless they are manually specified in the + :paramref:`.Insert.on_conflict_do_update.set_` dictionary. :param where: - Optional argument. If present, can be a literal SQL - string or an acceptable expression for a ``WHERE`` clause - that restricts the rows affected by ``DO UPDATE SET``. Rows - not meeting the ``WHERE`` condition will not be updated - (effectively a ``DO NOTHING`` for those rows). + Optional argument. If present, can be a literal SQL + string or an acceptable expression for a ``WHERE`` clause + that restricts the rows affected by ``DO UPDATE SET``. Rows + not meeting the ``WHERE`` condition will not be updated + (effectively a ``DO NOTHING`` for those rows). + + .. versionadded:: 1.1 - .. versionadded:: 1.1 .. seealso:: @@ -109,19 +110,19 @@ class Insert(StandardInsert): are optional, but only one of these can be specified. :param constraint: - The name of a unique or exclusion constraint on the table, - or the constraint object itself if it has a .name attribute. + The name of a unique or exclusion constraint on the table, + or the constraint object itself if it has a .name attribute. :param index_elements: - A sequence consisting of string column names, :class:`.Column` - objects, or other column expression objects that will be used - to infer a target index. + A sequence consisting of string column names, :class:`.Column` + objects, or other column expression objects that will be used + to infer a target index. :param index_where: - Additional WHERE criterion that can be used to infer a - conditional target index. + Additional WHERE criterion that can be used to infer a + conditional target index. - .. versionadded:: 1.1 + .. versionadded:: 1.1 .. seealso:: diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 8ac39c201..f538cd98d 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -5,12 +5,11 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://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...] + :connectstring: postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...] :url: http://pypi.python.org/pypi/psycopg2/ psycopg2 Connect Arguments @@ -31,6 +30,7 @@ psycopg2-specific keyword arguments which are accepted by Note that the :paramref:`.Connection.execution_options.stream_results` execution option is a more targeted way of enabling this mode on a per-execution basis. + * ``use_native_unicode``: Enable the usage of Psycopg2 "native unicode" mode per connection. True by default. @@ -56,7 +56,8 @@ psycopg2-specific keyword arguments which are accepted by * ``use_batch_mode``: This flag allows ``psycopg2.extras.execute_batch`` for ``cursor.executemany()`` calls performed by the :class:`.Engine`. It is currently experimental but - may well become True by default as it is critical for executemany performance. + may well become True by default as it is critical for executemany + performance. .. seealso:: @@ -79,10 +80,9 @@ using ``host`` as an additional keyword argument:: create_engine("postgresql+psycopg2://user:password@/dbname?\ host=/var/lib/postgresql") -See also: +.. seealso:: -`PQconnectdbParams <http://www.postgresql.org/docs/9.1/static/\ -libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_ + `PQconnectdbParams <http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS>`_ .. _psycopg2_execution_options: diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index d8ce7f394..a052fce4e 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -531,8 +531,7 @@ class DATETIME(_DateTimeMixin, sqltypes.DateTime): The default string storage format is:: - "%(year)04d-%(month)02d-%(day)02d %(hour)02d:%(min)02d:\ -%(second)02d.%(microsecond)06d" + "%(year)04d-%(month)02d-%(day)02d %(hour)02d:%(min)02d:%(second)02d.%(microsecond)06d" e.g.:: @@ -558,6 +557,7 @@ class DATETIME(_DateTimeMixin, sqltypes.DateTime): Otherwise, if positional groups are used, the datetime() constructor is called with positional arguments via ``*map(int, match_obj.groups(0))``. + """ _storage_format = ( diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 25dae6013..bd0bf9197 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -179,25 +179,25 @@ class SessionTransaction(object): .. seealso:: - :meth:`.Session.rollback` + :meth:`.Session.rollback` - :meth:`.Session.commit` + :meth:`.Session.commit` - :meth:`.Session.begin` + :meth:`.Session.begin` - :meth:`.Session.begin_nested` + :meth:`.Session.begin_nested` - :attr:`.Session.is_active` + :attr:`.Session.is_active` - :meth:`.SessionEvents.after_transaction_create` + :meth:`.SessionEvents.after_transaction_create` - :meth:`.SessionEvents.after_transaction_end` + :meth:`.SessionEvents.after_transaction_end` - :meth:`.SessionEvents.after_commit` + :meth:`.SessionEvents.after_commit` - :meth:`.SessionEvents.after_rollback` + :meth:`.SessionEvents.after_rollback` - :meth:`.SessionEvents.after_soft_rollback` + :meth:`.SessionEvents.after_soft_rollback` """ diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 13e418390..ef49ffd60 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -226,7 +226,7 @@ class Pool(log.Identified): to the :class:`.Pool`. :param pre_ping: if True, the pool will emit a "ping" (typically - "SELECT 1", but is dialect-specific) on the connection + "SELECT 1", but is dialect-specific) on the connection upon checkout, to test if the connection is alive or not. If not, the connection is transparently re-connected and upon success, all other pooled connections established prior to that timestamp are @@ -234,6 +234,7 @@ class Pool(log.Identified): interpret the disconnection error. .. versionadded:: 1.2 + """ if logging_name: self.logging_name = self._orig_logging_name = logging_name |
