PySqlLite Database Paths on Windows

5 views
Skip to first unread message

sean d

unread,
Oct 2, 2005, 12:49:55 PM10/2/05
to TurboGears
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

Waldemar Osuch

unread,
Oct 2, 2005, 1:28:46 PM10/2/05
to TurboGears

One more way if the database sits on something different than C:
sqlite://D|data/projects/www/wiki20/wiki20.db

There is PIPE instead of COLON. I wish it was mentioned somwhere in
documentation.

Waldemar

Uwe Grauer

unread,
Oct 2, 2005, 2:08:38 PM10/2/05
to turbo...@googlegroups.com
Yes, i also had to resolve this for myself.
In fact, the Pipe-Notion for the ':' isn't something which you are aware
of normally.
Could this go into the 20 Minute wiki?
It would even be better sticking a comment into dev.cfg.

Uwe

sean d

unread,
Oct 2, 2005, 2:12:52 PM10/2/05
to TurboGears
Thanks for the note on the pipe. I was wondering how to specify a
different drive letter.

Kevin Dangoor

unread,
Oct 2, 2005, 3:15:25 PM10/2/05
to turbo...@googlegroups.com
On 10/2/05, Uwe Grauer <mailin...@onlinehome.de> wrote:
> Yes, i also had to resolve this for myself.
> In fact, the Pipe-Notion for the ':' isn't something which you are aware
> of normally.
> Could this go into the 20 Minute wiki?
> It would even be better sticking a comment into dev.cfg.

I've just added a note to the config file.

Kevin

--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: k...@blazingthings.com
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com
Reply all
Reply to author
Forward
0 new messages