dabo Commit 5509

View: New views
1 Messages — Rating Filter:   Alert me  

dabo Commit 5509

by Paul McNett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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: Dabo-dev@...
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/20091029175451.AA95C318ACB@...