This is probably obvious to all who have used pysqlite, but I
experienced problems when trying to set the correct path for a sqlite
database on my Windows box.  Here's a summary of what I've found in
case you're having trouble too:

Say you want to store your database at "C:\data\projects\www\wiki20",
with a name of "wiki20db".  The correct way to set this in the
turbogears *.cfg file is as follows:

sqlobject.dburi="sqlite:///data/projects/www/wiki20/wiki20db"

I had some difficulty in finding the correct format for the connection
string because I wanted to add 'c:' to the beginning of the path.  If
you do try to use 'c:' in the path (e.g.
sqlobject.dburi="sqlite:///C:/data/projects/www/wiki20/wiki20db"), you
will receive an error.

Other correct ways to specify the path:

sqlobject.dburi="sqlite:///./wiki20db"
sqlobject.dburi="sqlite:///wiki20db"

Both of these entries will place the database file at the root of the
drive.

Thanks,

Sean

Reply via email to