Thread: [SQLObject] MySQLConnection is deprecated
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nigel K. <Ki...@di...> - 2004-11-01 16:27:28
|
Hi, I get the following warning on my MySQLConnection /usr/local/lib/python2.3/site-packages/sqlobject/__init__.py:23: DeprecationWarning: MySQLConnection is deprecated; use connectionForURI("mysql://...") or "from sqlobject.mysql import builder; MySQLConnection = builder()" _warn('MySQLConnection is deprecated; use connectionForURI("mysql://...") or "from sqlobject.mysql import builder; MySQLConnection = builder()"') In the manual it says to use conn = MySQLConnection(user='test', db='testdb') which is the method I use. What is actually intended? Nigel King |
From: Ian B. <ia...@co...> - 2004-11-01 21:04:50
|
Nigel King wrote: > I get the following warning on my MySQLConnection > > /usr/local/lib/python2.3/site-packages/sqlobject/__init__.py:23: > DeprecationWarning: MySQLConnection is deprecated; use > connectionForURI("mysql://...") or "from sqlobject.mysql import builder; > MySQLConnection = builder()" > _warn('MySQLConnection is deprecated; use > connectionForURI("mysql://...") or "from sqlobject.mysql import builder; > MySQLConnection = builder()"') > > In the manual it says to use > conn = MySQLConnection(user='test', db='testdb') > which is the method I use. > > What is actually intended? I just haven't reviewed the documentation since then. Though I'm not 100% sure that MySQLConnection and friends should be deprecated. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: David M. C. <da...@da...> - 2004-11-01 21:44:24
|
On Mon, Nov 01, 2004 at 03:04:28PM -0600, Ian Bicking wrote: > I just haven't reviewed the documentation since then. Though I'm not > 100% sure that MySQLConnection and friends should be deprecated. Maybe I'm wrong, but the URI format doesn't seem very win32 friendly. Dave Cook |
From: Ian B. <ia...@co...> - 2004-11-01 22:06:21
|
David M. Cook wrote: > On Mon, Nov 01, 2004 at 03:04:28PM -0600, Ian Bicking wrote: >>I just haven't reviewed the documentation since then. Though I'm not >>100% sure that MySQLConnection and friends should be deprecated. > > Maybe I'm wrong, but the URI format doesn't seem very win32 friendly. How so? Forward slashes can always replace backslashes for paths (and even that only applies to SQLite and Firebird, since the other databases don't use file paths anywhere). -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Brian B. <ex...@gm...> - 2004-11-15 04:40:38
|
Ian Bicking <ianb <at> colorstudy.com> writes: > > Maybe I'm wrong, but the URI format doesn't seem very win32 friendly. > > How so? Forward slashes can always replace backslashes for paths (and > even that only applies to SQLite and Firebird, since the other databases > don't use file paths anywhere). > On Win32 for SQLite, I can only use sqlite:/file.db or sqlite:///file.db, AND this creates the file in the ROOT directory of whatever drive the script is running from, NOT the path of the script! This is highly undesirable. Brian |
From: Ian B. <ia...@co...> - 2004-11-15 16:47:54
|
Brian Beck wrote: > Ian Bicking <ianb <at> colorstudy.com> writes: > > >>>Maybe I'm wrong, but the URI format doesn't seem very win32 friendly. >> >>How so? Forward slashes can always replace backslashes for paths (and >>even that only applies to SQLite and Firebird, since the other databases >>don't use file paths anywhere). >> > > > On Win32 for SQLite, I can only use sqlite:/file.db or sqlite:///file.db, Right, because there's no server for SQLite, so there's no remote host possible. > AND > this creates the file in the ROOT directory of whatever drive the script is > running from, NOT the path of the script! This is highly undesirable. Hmm... unfortunately I can't think of any way of indicating the current directory in a fully qualified URI. Does anyone have ideas? sqlite:/:pwd:/file.db ? -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |
From: Nick <ni...@dd...> - 2004-11-15 17:01:04
|
Ian Bicking wrote: > Hmm... unfortunately I can't think of any way of indicating the current > directory in a fully qualified URI. Does anyone have ideas? > sqlite:/:pwd:/file.db ? To be a proper URI, my guess would be sqlite:.%2Ffile.db Nick |
From: Derrick H. <dma...@dm...> - 2004-11-17 18:36:46
|
On Mon, Nov 15, 2004 at 10:45:08AM -0600, Ian Bicking wrote: | Brian Beck wrote: | >On Win32 for SQLite, I can only use sqlite:/file.db or sqlite:///file.db= ,=20 | >AND | >this creates the file in the ROOT directory of whatever drive the script= is | >running from, NOT the path of the script! This is highly undesirable. |=20 | Hmm... unfortunately I can't think of any way of indicating the current= =20 | directory in a fully qualified URI. Does anyone have ideas?=20 | sqlite:/:pwd:/file.db ? Solution #1: Use the cygwin python.exe and write the URI as sqlite:/cygdrive/m/path/to/whatever/file.db Solution #2: Devise a way to embed the drive letter in the URI. As a first approach I would look for any documentation or examples that show how msvcrt.dll's fopen() parses out drive letters, then document using that same notation. (this is the same way forward slashes are handled -- Tim Peters once revealed on c.l.py that Windows' fopen() accepts forward slashes even though command.com and cmd.exe don't) Presumably in an application you will ask the user where the database should be stored instead of assuming it will reside in the application's own directory. HTH, -D --=20 Microsoft is to operating systems & security .... .... what McDonald's is to gourmet cook= ing =20 www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.= org |