Re: RFI: Database URIs

Darren Duncan <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
Sorry, I think I hit send without adding a reply message; here it is.

On 2013.11.22 5:13 PM, David E. Wheeler wrote:
> First, I'm using the database name as the scheme in the URL. Some examples:
>
>      postgresql://user@localhost:5433/dbname
>      sqlite:///path/to/foo.db

By "database name" do you mean "DBMS name"?  Because I'd say the "database name" 
is what's on the right-hand side of the //, not what's on the left.

Another thing I was going to say is, if you wanted some standardization, you 
should distinguish the parts that are necessary to connect to a database from 
parts that just select a default schema in the database for interacting with.

By that I mean, remember that a PostgreSQL "database" and a MySQL "database" 
aren't actually the same concept.  A PostgreSQL DBMS server gives access to 
multiple disjoint databases where you must name one to connect, and then 
separately from that is the optional concept of the current schema that you can 
select.  A MySQL DBMS server gives access to exactly 1 database, which you can 
connect to without specifying a "database name", and selecting a current schema 
(what they call a "database") is optional for using MySQL.

The reason I say this is that DBI's uri scheme uses the same syntax for both 
"database" even though how they're treated is actually very different.  And you 
don't have to do the same.

-- Darren Duncan
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.