From 0285ec6beb695bf38ae5cccef8245e04fe5585a0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 14 Aug 2007 00:40:23 +0000 Subject: added engine_from_config() function for helping to create_engine() from an .ini style config --- lib/sqlalchemy/engine/url.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/engine/url.py') diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index 98d4d442e..31546bae8 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -66,7 +66,17 @@ class URL(object): keys.sort() s += '?' + "&".join(["%s=%s" % (k, self.query[k]) for k in keys]) return s - + + def __eq__(self, other): + return \ + isinstance(other, URL) and \ + self.drivername == other.drivername and \ + self.username == other.username and \ + self.password == other.password and \ + self.host == other.host and \ + self.database == other.database and \ + self.query == other.query + def get_dialect(self): """Return the SQLAlchemy database dialect class corresponding to this URL's driver name.""" dialect=None -- cgit v1.2.1