--- /dev/null
+.. change::
+ :tags: bug, engine
+
+ Added the "future" keyword to the list of words that are known by the
+ :func:`_sa.engine_from_config` function, so that the values "true" and
+ "false" may be configured as "boolean" values when using a key such
+ as ``sqlalchemy.future = true`` or ``sqlalchemy.future = false``.
+
pool._dialect = dialect
# create engine.
- if kwargs.pop("future", False):
+ if pop_kwarg("future", False):
from sqlalchemy import future
default_engine_class = future.Engine
("pool_recycle", util.asint),
("pool_size", util.asint),
("max_overflow", util.asint),
+ ("future", util.asbool),
]
)
)
assert e.echo is True
+ def test_engine_from_config_future(self):
+ dbapi = mock_dbapi
+
+ config = {
+ "sqlalchemy.url": "postgresql://scott:tiger@somehost/test"
+ "?fooz=somevalue",
+ "sqlalchemy.future": "true",
+ }
+
+ e = engine_from_config(config, module=dbapi, _initialize=False)
+ assert e._is_future
+
+ def test_engine_from_config_not_future(self):
+ dbapi = mock_dbapi
+
+ config = {
+ "sqlalchemy.url": "postgresql://scott:tiger@somehost/test"
+ "?fooz=somevalue",
+ "sqlalchemy.future": "false",
+ }
+
+ e = engine_from_config(config, module=dbapi, _initialize=False)
+ assert not e._is_future
+
def test_pool_reset_on_return_from_config(self):
dbapi = mock_dbapi