Author: phd
Date: 2009-04-29 09:20:56 -0600 (Wed, 29 Apr 2009)
New Revision: 3867
Modified:
SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
Log:
Make sqlite URI nicer.
Modified: SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2009-04-23 12:33:51 UTC (rev 3866)
+++ SQLObject/branches/0.9/sqlobject/sqlite/sqliteconnection.py 2009-04-29 15:20:56 UTC (rev 3867)
@@ -106,7 +106,12 @@
connectionFromURI = classmethod(connectionFromURI)
def uri(self):
- return 'sqlite:///%s' % self.filename
+ path = self.filename
+ if path == ":memory:":
+ path = "/:memory:"
+ else:
+ path = "//" + path
+ return 'sqlite:%s' % path
def getConnection(self):
# SQLite can't share connections between threads, and so can't
|