[orm-devel] Unified Connection Strings
Sun, 01 Dec 2002 08:02:43 -0800
My vote is for the 'Postgres' style
dsn = "adapter=pgsql dbname=test user=diedrich password=secret"
Another Python Postgres DA uses the format:
connect_string = 'host:port:database:user:password:options:tty'
But I'm in favor of clarity, so the latter example fails because when
optional parameters are missing you end up with something like:
connect_string = 'orpheum::testdb::::'
which isn't very clear to me.
arg = parameter I can remember !
Plus it is easily extended with new args should the need arise.
At 01:04 PM 12/1/2002 +0100, you wrote:
>A good day to everyone :-)
>I'll have to make a design decision regarding orm and I'd like to
>hear your opinions on this:
>Writing the test programs I would have liked to add the ablility to
>pass connections parameters as a single string on the command line.
>Here I used -u -d -p parameters to get around this. Now I'm writing a
>ORMDatasourcePool Product for Zope and ran into the same problem: how
>to specify database connection parameters in a unified way.
>There are two approaches I'm considering (any more ideas very
>welcome): PostgreSQL's DSN syntax:
> dsn = "adapter=pgsql dbname=test user=diedrich password=secret"
>or the JDBC style urls
> url = "pgsql://diedrich:secret@localhost/test"
>Personally I like Postgres' way of doing things better: easier to
>read, easier to parse and all in all very practical. The url style's
>advantages are: they are used by one of the most popular database
>access infrastructure and they fit into a single string on the command
>Does anyone know who else is using this url style notation? Is there
>a standard like an RFC or so? Do you think it's worth the effort to
>Any comment is very welcome!
> _..._ Diedrich Vorberg
> .' '.
> / _ _ \ http://www.tux4web.de
> | (o)_(o) | firstname.lastname@example.org
> \( ) / .---.
> //'._.'\ \ / \ Internet Dienstleistungen
> // . \ \ \.@-@./ und 'Consulting'.
> || . \ \ /`\_/`\
> |\ : / | // _ \\ Linux Rules!
> \ `) ' (` /_ | \ )|_
> _)``".____,.'"` (_ /`\_`> <_/ \
> ) )'--'( ( \__/'---'\__/
> '---` `---`
>orm-devel mailing list