Re: RFI: Database URIs

"David E. Wheeler" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Nov 26, 2013, at 10:53 AM, David E. Wheeler <[email protected]> wrote:

> Well, I can see I have a bug or two to work out. That should be:
> 
>    $ perl -MURI -Ilib -E 'say URI->new("db:pg://me:[email protected]/foo.db")->dbi_dsn'
>    dbi:Pg:host=example.com;dbname=foo.db

Oh silly me not escaping the "@". Let’s try that again:

    $ perl -Ilib -MURI -E 'say URI->new(shift)->dbi_dsn' db:pg://me:[email protected]/foo_db       
    dbi:Pg:host=example.com;dbname=foo_db

    $ perl -Ilib -MURI -E 'say URI->new(shift)->dbi_dsn' db:ingres://me:[email protected]/foo_db    
    dbi:Ingres:foo_db

    $ perl -Ilib -MURI -E 'say URI->new(shift)->dbi_dsn' db:sqlserver://me:[email protected]/foo_db 
    dbi:ODBC:Driver={SQL Server};Server=example.com;Database=foo_db

Much saner. :-)

Best,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.