[Nitro] [OG] RFC uri structure

Mark Van De Vyver mvyver at gmail.com
Mon Nov 5 15:04:27 EST 2007


On Nov 5, 2007 11:20 PM, Dan North <tastapod at gmail.com> 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



>
>
>
>  On 11/3/07, George Moschovitis <george.moschovitis at gmail.com> wrote:
> > I would say
> >
> > dbi-vendor...
> >
> > -g.
> >
> >
> >
> > On Nov 2, 2007 9:26 PM, Mark Van De Vyver < mvyver at gmail.com> wrote:
> >
> > > 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-<vendor>://user:
> pass at localhost:9876/dbname#<vendor>driveroptions"
> > > b)
> "dbi:<vendor>://user:pass at localhost:9876/dbname#<vendor>driveroptions"
> > > c) both
> > > d) neither (please tell/suggest)
> > >
> > > Some notes:
> > > - "DBI" and <vendor> 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
> > > _______________________________________________
> > > Nitro-general mailing list
> > > Nitro-general at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/nitro-general
> > >
> >
> >
> >
> > --
> > http://me.gr
> > http://joy.gr
> > http://cull.gr
> > http://nitroproject.org
> > http://phidz.com
> > http://joyerz.com
> > _______________________________________________
> > Nitro-general mailing list
> > Nitro-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/nitro-general
> >
>
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>


More information about the Nitro-general mailing list