# shut up useless SA warning:
import warnings
warnings.filterwarnings(
    'ignore', 'Unicode type received non-unicode bind param value.')

from dataset.persistence.database import Database
from dataset.persistence.table import Table
from dataset.freeze.app import freeze

__all__ = ['Database', 'Table', 'freeze', 'connect']


def connect(url, reflectMetadata=True):
    """
    Opens a new connection to a database. *url* can be any valid `SQLAlchemy engine URL`_. Returns
    an instance of :py:class:`Database <dataset.Database>`. Set *reflectMetadata* to False if you
    don't want the entire database schema to be pre-loaded. This significantly speeds up
    connecting to large databases with lots of tables.
    ::

        db = dataset.connect('sqlite:///factbook.db')

    .. _SQLAlchemy Engine URL: http://docs.sqlalchemy.org/en/latest/core/engines.html#sqlalchemy.create_engine
    """
    return Database(url, reflectMetadata)

@@ -1,8 +1,18 @@
+import os%0A
 # shut u
@@ -343,24 +343,29 @@
  connect(url
+=None
 , reflectMet
@@ -479,16 +479,109 @@
 L%60_.
+%0A    If *url* is not defined it will try to use *DATABASE_URL* from environment variable.%0A   
  Returns
 %0A   
@@ -576,20 +576,16 @@
  Returns
-%0A   
  an inst
@@ -993,24 +993,70 @@
 ine%0A    %22%22%22%0A
+    url = os.environ.get('DATABASE_URL', url)%0A
     return D

Allow to use `url` defined as env variable.