diff options
Diffstat (limited to 'lib/sqlalchemy/engine/__init__.py')
| -rw-r--r-- | lib/sqlalchemy/engine/__init__.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/sqlalchemy/engine/__init__.py b/lib/sqlalchemy/engine/__init__.py index 0a5a96784..890c76645 100644 --- a/lib/sqlalchemy/engine/__init__.py +++ b/lib/sqlalchemy/engine/__init__.py @@ -1,5 +1,5 @@ # engine/__init__.py -# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> +# Copyright (C) 2005-2014 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 @@ -50,14 +50,13 @@ url.py within a URL. """ -# not sure what this was used for -#import sqlalchemy.databases - from .interfaces import ( - Compiled, Connectable, Dialect, ExecutionContext, + + # backwards compat + Compiled, TypeCompiler ) @@ -83,8 +82,12 @@ from .util import ( connection_memoize ) + from . import util, strategies +# backwards compat +from ..sql import ddl + default_strategy = 'plain' @@ -345,10 +348,13 @@ def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs): arguments. """ - opts = util._coerce_config(configuration, prefix) - opts.update(kwargs) - url = opts.pop('url') - return create_engine(url, **opts) + options = dict((key[len(prefix):], configuration[key]) + for key in configuration + if key.startswith(prefix)) + options['_coerce_config'] = True + options.update(kwargs) + url = options.pop('url') + return create_engine(url, **options) __all__ = ( |
