[OG] RFC uri structure

Hi Devs,
The Sequel/Datasets thread was ominously silent - nonetheless pushing
ahead.

If you were able to start Og in the following way:
Og(uri)

What would be the preferred uri format:
a)
“dbi-://user:pass@localhost:9876/dbname#driveroptions”
b)
“dbi:://user:pass@localhost:9876/dbname#driveroptions”
c) both
d) neither (please tell/suggest)

Some notes:

  • “DBI” and would be case insensitive.
  • Not all arguments are ‘required’. The following would work (assuming
    (a)),
    “DBI-mysql:///testdb”
    and even
    “dbi:///testdb”
    In that missing arguments would employ the defaults as specific by the
    settings in og.rb.

Regards
Mark

I would say

dbi-vendor…

-g.

Perl uses a format called a DSN. Since there is already a convention, we
should try to adhere to that.

It looks roughly like: dbi:vendor:other-stuff, but I’m not sure of the
specifics.

On Nov 5, 2007 11:20 PM, Dan N. [email protected] wrote:

Perl uses a format called a DSN. Since there is already a convention, we
should try to adhere to that.

Agreed. It looks like the Ruby DBI spec pay some homage to Perl.
Essentially the uri is parsed into the dsn. To support both, it would
be a case of distinguishing a dsn from a uri.
I’ll try to do that.

It looks roughly like: dbi:vendor:other-stuff, but I’m not sure of the
specifics.

That is right, the other stuff is ‘;’ delimited: “param=value”.

Anyway a complete uri at the moment will be (the generic uri
definition):

“dbi-sqlite://username:pass@localhost:9876/dbname#other-stuff”

where other stuff is in the format of ‘other-stuff’ above.

this gets parsed into the dsn:

dbi:sqlite:user=username;password=pass;host=localhost;port=9876;database=dbname;other-stuff

My intention is that if a parameter value isn’t given then a vendor
specific default value is employed.
So the following should work:

Og(“dbi-sqlite:/”)

Lats note: The uri contents are parsed into the options hash and
should (I’ll give it a try) work with other (non-dbi) adapters…

Regards
Mark