6 from wizard import shell
8 # We're going to use sqlalchemy.engine.url.URL as our database
9 # info intermediate object
12 """Convenience method for connecting to a MySQL database."""
13 engine = sqlalchemy.create_engine(url)
14 meta = sqlalchemy.MetaData()
21 If the URL has a database name but no other values, it will
22 use the global configuration, and then try the database name.
24 This function implements a plugin interface named
25 :ref:`wizard.sql.auth`.
32 # omitted port and query
33 if any((url.host, url.username, url.password)):
34 # don't try for defaults if a few of these were set
36 for entry in pkg_resources.iter_entry_points("wizard.sql.auth"):
38 r = func(copy.copy(url))
42 env_dsn = os.getenv("WIZARD_DSN")
45 url = sqlalchemy.engine.url.make_url(env_dsn)
46 url.database = old_url.database