diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-04-07 13:34:38 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-04-07 13:34:38 -0400 |
| commit | 51fea2e159ca93daa0bc8066a5c35d8436d99418 (patch) | |
| tree | b66da19cf5cd027a31a7b574dbeee5ecd529527b /lib/sqlalchemy/util | |
| parent | 708a25e76a3cb9528c65d45ad37fc562cf178e44 (diff) | |
| download | sqlalchemy-51fea2e159ca93daa0bc8066a5c35d8436d99418.tar.gz | |
- The limit/offset keywords to select() as well
as the value passed to select.limit()/offset()
will be coerced to integer. [ticket:2116]
(also in 0.6.7)
- Oracle dialect adds use_binds_for_limits=False
create_engine() flag, will render the LIMIT/OFFSET
values inline instead of as binds, reported to
modify the execution plan used by Oracle.
[ticket:2116] (Also in 0.6.7)
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/__init__.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py index 7e8ce59c4..93c418eda 100644 --- a/lib/sqlalchemy/util/__init__.py +++ b/lib/sqlalchemy/util/__init__.py @@ -25,7 +25,7 @@ from langhelpers import iterate_attributes, class_hierarchy, \ monkeypatch_proxied_specials, asbool, bool_or_str, coerce_kw_type,\ duck_type_collection, assert_arg_type, symbol, dictlike_iteritems,\ classproperty, set_creation_order, warn_exception, warn, NoneType,\ - constructor_copy, methods_equivalent, chop_traceback + constructor_copy, methods_equivalent, chop_traceback, asint from deprecations import warn_deprecated, warn_pending_deprecation, \ deprecated, pending_deprecation diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index cbe0d2a4f..ba612bc2c 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -551,6 +551,14 @@ def bool_or_str(*text): return asbool(obj) return bool_or_value +def asint(value): + """Coerce to integer.""" + + if value is None: + return value + return int(value) + + def coerce_kw_type(kw, key, type_, flexi_bool=True): """If 'key' is present in dict 'kw', coerce its value to type 'type\_' if necessary. If 'flexi_bool' is True, the string '0' is considered false |
