dabo Commit
Revision 5509
Date: 2009-10-29 10:54:51 -0700 (Thu, 29 Oct 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5509
Changed:
U trunk/dabo/db/__init__.py
Log:
Made dabo.db.connect() even more convenient for setting up in-memory databases.
Now just call:
con = dabo.db.connect(":memory:")
cur = con.cursor()
Diff:
Modified: trunk/dabo/db/__init__.py
===================================================================
--- trunk/dabo/db/__init__.py 2009-10-27 22:25:44 UTC (rev 5508)
+++ trunk/dabo/db/__init__.py 2009-10-29 17:54:51 UTC (rev 5509)
@@ -77,6 +77,11 @@
Passed connection info can either be in the form of a dConnectInfo
object,
or individual arguments to pass to dConnection's constructor.
"""
+ if args == (":memory:",) and not kwargs:
+ # special case:
+ kwargs["DbType"] = "SQLite"
+ kwargs["Database"] = ":memory:"
+ args = ()
return dConnection(*args, **kwargs)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]