[DB-SIG] URI syntax for database (was: [SQLObject] Re: SQLite connection - relative filename)

Ian Bicking ianb at colorstudy.com
Mon Apr 4 18:20:36 CEST 2005


M.-A. Lemburg wrote:
>>c) Should username and password be used similar to other protocols?
>>  pydbapi:<modulepath>://[<username>:<password>@]<host>[:
>><port>/
> 
> 
> This is not URI conformant (AFAIK): you cannot have multiple
> schemes separated by colons.
> 
> pydbapi-<modulepath>://...

Well, I think it's up to scheme to parse the rest of the URI, so the 
scheme would be "pydbapi", and it in turn would parse out the module.  I 
think this would be more compliant than:

> would work, e.g.
> 
> pydbapi-mx.ODBC.Windows://<uid>:<pwd>@sqlserver.example.com/?DATABASE=test

Which really puts something more data-like into the scheme.  But then I 
still prefer using a plain module name, like:

mxODBC://user:password@host/database?params

Of course, I do believe it's illegal to have punctuation in the scheme 
as well... well, I guess not, according to this: 
http://www.w3.org/Addressing/URL/5_URI_BNF.html

While it's nice to be able to find modules given a URI (without 
preloading any modules) I must admit I am rather reluctant to burden 
users with what I consider to be internal organizations, like 
mx.ODBC.Windows, or a particular Postgres driver.

> Looking at this URI I don't think that the URI-approach is
> going to make things any easier for the user in setting up
> things.

Well, I can say that *I* find them very useful and comfortable when 
configuring SQLObject, even though I initially didn't think they were 
that important.  I suspect that the effect would actually be magnified 
for someone with less experience using Python database drivers.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the DB-SIG mailing list