diff options
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 564fa50a9..2210ba408 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -173,7 +173,7 @@ class Dialect(object): """Transform a generic type to a dialect-specific type. Dialect classes will usually use the - :func:`~sqlalchemy.types.adapt_type` method in the types module to + :func:`~sqlalchemy.types.adapt_type` function in the types module to make this job easy. The returned result is cached *per dialect class* so can @@ -581,6 +581,19 @@ class ExecutionContext(object): raise NotImplementedError() + def get_rowcount(self): + """Return the number of rows produced (by a SELECT query) + or affected (by an INSERT/UPDATE/DELETE statement). + + Note that this row count may not be properly implemented + in some dialects; this is indicated by the + ``supports_sane_rowcount`` and ``supports_sane_multi_rowcount`` + dialect attributes. + + """ + + raise NotImplementedError() + class Compiled(object): """Represent a compiled SQL or DDL expression. @@ -1767,13 +1780,12 @@ class ResultProxy(object): uses and is not intended to provide the number of rows present from a SELECT. - Additionally, this value is only meaningful if the - dialect's supports_sane_rowcount flag is True for - single-parameter executions, or supports_sane_multi_rowcount - is true for multiple parameter executions - otherwise - results are undefined. + Note that this row count may not be properly implemented + in some dialects; this is indicated by + :meth:`~sqlalchemy.engine.base.ResultProxy.supports_sane_rowcount()` and + :meth:`~sqlalchemy.engine.base.ResultProxy.supports_sane_multi_rowcount()`. - rowcount may not work at this time for a statement + ``rowcount()`` also may not work at this time for a statement that uses ``returning()``. """ |