]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add a warning regarding tuple.in_(), [ticket:2395]
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Feb 2012 19:31:10 +0000 (14:31 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Feb 2012 19:31:10 +0000 (14:31 -0500)
- cleanup of exc.DBAPIError docstrings

lib/sqlalchemy/exc.py
lib/sqlalchemy/sql/expression.py

index 64f25a22ff16cffe73ee080eedce20e9d9f14a8f..91ffc2811b523d347ecb3775c05aa27eb0a71ade 100644 (file)
@@ -162,7 +162,7 @@ UnmappedColumnError = None
 class StatementError(SQLAlchemyError):
     """An error occurred during execution of a SQL statement.
     
-    :class:`.StatementError` wraps the exception raised
+    :class:`StatementError` wraps the exception raised
     during execution, and features :attr:`.statement`
     and :attr:`.params` attributes which supply context regarding
     the specifics of the statement which had an issue.
@@ -172,6 +172,15 @@ class StatementError(SQLAlchemyError):
     
     """
 
+    statement = None
+    """The string SQL statement being invoked when this exception occurred."""
+
+    params = None
+    """The parameter list being used when this exception occurred."""
+
+    orig = None
+    """The DBAPI exception object."""
+
     def __init__(self, message, statement, params, orig):
         SQLAlchemyError.__init__(self, message)
         self.statement = statement
@@ -192,21 +201,21 @@ class StatementError(SQLAlchemyError):
 class DBAPIError(StatementError):
     """Raised when the execution of a database operation fails.
 
-    ``DBAPIError`` wraps exceptions raised by the DB-API underlying the
+    Wraps exceptions raised by the DB-API underlying the
     database operation.  Driver-specific implementations of the standard
     DB-API exception types are wrapped by matching sub-types of SQLAlchemy's
-    ``DBAPIError`` when possible.  DB-API's ``Error`` type maps to
-    ``DBAPIError`` in SQLAlchemy, otherwise the names are identical.  Note
+    :class:`DBAPIError` when possible.  DB-API's ``Error`` type maps to
+    :class:`DBAPIError` in SQLAlchemy, otherwise the names are identical.  Note
     that there is no guarantee that different DB-API implementations will
     raise the same exception type for any given error condition.
 
-    :class:`.DBAPIError` features :attr:`.statement`
-    and :attr:`.params` attributes which supply context regarding
+    :class:`DBAPIError` features :attr:`~.StatementError.statement`
+    and :attr:`~.StatementError.params` attributes which supply context regarding
     the specifics of the statement which had an issue, for the 
     typical case when the error was raised within the context of
     emitting a SQL statement.
 
-    The wrapped exception object is available in the :attr:`.orig` attribute.
+    The wrapped exception object is available in the :attr:`~.StatementError.orig` attribute.
     Its type and properties are DB-API implementation specific.
 
     """
index bff086e4b3fbc646cfdf99ce0e2b6edbb2988231..859ee0437232a95a7b6ccfa43a1962dd1c1bcba6 100644 (file)
@@ -832,6 +832,14 @@ def tuple_(*expr):
             [(1, 2), (5, 12), (10, 19)]
         )
 
+    .. warning::
+    
+        The composite IN construct is not supported by all backends, 
+        and is currently known to work on Postgresql and MySQL,
+        but not SQLite.   Unsupported backends will raise
+        a subclass of :class:`~sqlalchemy.exc.DBAPIError` when such 
+        an expression is invoked.
+
     """
     return _Tuple(*expr)