|
From: <ab...@ne...> - 2005-06-06 05:02:19
|
Brian Beck wrote:
> Also, I"m pretty sure the connection syntax Andy used is the only way t=
o
> specify a relative path. I also use that form when using SQLObject with
> Windows.
Indeed that's right - the syntax I originally used
from sqlobject.sqlite import builder; SQLiteConnection =3D builder()
conn =3D SQLiteConnection('persontest3.db', debug=3DFalse)
whilst convoluted, at least lets me specify that the db be in the same di=
rectory
as my source code. So whilst the shorter syntax works - I've since disco=
vered
that it actually creates the db file in the root of my windows C: drive! =
Not
what I want.
conn =3D "sqlite:/persontest3.db?debug=3D"
Also, I'm still not clear as to why the documentation refers to a double =
slash
// but in actual use, only a single slash actually works. E.g. the code l=
ine
above works, but if you put in // it won't work.
Note that when specifying a full pathname, it seems that either double or=
single
path will work. e.g.
conn =3D "sqlite://C|/person test/persontest3.db" OR
conn =3D "sqlite:/C|/person test/persontest3.db"
In summary:
It seems that "sqlite://file" style connection strings=20
* only actually work if its a single slash
* don't let you put the db in the same directory or a relative direct=
ory
-Andy Bulka
http://www.atug.com/andypatterns
------------------------------------------------------------
This email was sent from Netspace Webmail: http://www.netspace.net.au
|