comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@NoSpam.cogeco.ca>
Subject: Re: Ada DB bindings and APQ
Date: Tue, 14 Dec 2004 22:23:38 -0500
Date: 2004-12-14T22:23:38-05:00	[thread overview]
Message-ID: <17Ovd.52$Wt5.33108@read2.cgocable.net> (raw)
In-Reply-To: <sa48y80ec6a.fsf@snoopy.apana.org.au>

Brian May wrote:
>>>>>>"Warren" == Warren W Gay VE3WWG <ve3wwg@NoSpam.cogeco.ca> writes:
>     Warren> I'm not against the "factory" idea, but i don't think it
>     Warren> will prove to be very practical. The problem is that every
>     Warren> database vendor has its own unique way of identifying
>     Warren> users to the database. PostgreSQL is perhaps the strangest
>     Warren> of them all, and they all overlap, but none of them agree
>     Warren> on the required set of parameters. You can possibly make
>     Warren> them agree in some situations, but this doesn't address
>     Warren> existing databases well.
> 
> The solution here is to use a notation for identifying the database
> that will work for all database.
> 
> I have to say I really like the PHP pear URL like syntax, copied from:
> 
> <URL:http://pear.php.net/manual/en/package.database.db.intro-dsn.php>
> 
> Example 26-1. Connect to database through a socket
> 
> mysql://user@unix(/path/to/socket)/pear
> 
> Example 26-2. Connect to database on a non standard port
> 
> pgsql://user:pass@tcp(localhost:5555)/pear

That's not bad actually. That would also let the application
designer put all that nasty config data in one environment
variable (or command argument).

> Example 26-3. Connect to SQLite on a Unix machine using options
> 
> sqlite:////full/unix/path/to/file.db?mode=0666

Not sure why there are so many leading slashes in this case.

> Example 26-4. Connect to SQLite on a Windows machine using options
> 
> sqlite:///c:/full/windows/path/to/file.db?mode=0666
> 
> Example 26-5. Connect to MySQLi using SSL
> 
> mysqli://user:pass@localhost/pear?key=client-key.pem&cert=client-cert.pem
> 
> Example 26-6. Connecting to MS Access sometimes requires admin as the user name
> 
> odbc(access)://admin@/datasourcename
> 
> Example 26-7. Connecting to ODBC with a specific cursor
> 
> odbc(access)://admin@/datasourcename?cursor=SQL_CUR_USE_ODBC
> 
> pgsql://someuser:apasswd@localhost/thedb
> 
> I think this is rather important as it would mean you don't need to
> recompile the application in order to use a different database. It
> also means the code doesn't have to explicitly support connecting to
> every possible database that APQ supports.
> 
> Instead you just need *one* config option "database_url" that contains
> the URL as per one of the above format.
> 
> If you want sample code to pass the URL, it is already written, it
> just needs to be ported from PHP to Ada... Not sure how easy this will
> be.

I like this idea. What it needs on the Linux/*NIX side is to use
dynamically loaded libraries, so that it doesn't insist on all
other shared libraries, even when not used. The shared library
should only be loaded when required.
--
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg



  reply	other threads:[~2004-12-15  3:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-12 17:42 Ada DB bindings and APQ Dmitry A. Kazakov
2004-12-14  7:25 ` Warren W. Gay VE3WWG
2004-12-14 17:37   ` Dmitry A. Kazakov
2004-12-14 18:29     ` Georg Bauhaus
2004-12-14 19:45       ` Dmitry A. Kazakov
2004-12-14 21:06         ` Georg Bauhaus
2004-12-15  8:19           ` Ole-Hjalmar Kristensen
2004-12-15 17:20           ` Dmitry A. Kazakov
2004-12-16 13:28             ` Georg Bauhaus
2004-12-17 13:23               ` Dmitry A. Kazakov
2004-12-14 23:26         ` Brian May
2004-12-15 17:43           ` Dmitry A. Kazakov
2004-12-15 21:54             ` Brian May
2004-12-15  4:05     ` Warren W. Gay VE3WWG
2004-12-15 18:26       ` Dmitry A. Kazakov
2004-12-16  2:53         ` Warren W. Gay VE3WWG
2004-12-18 16:43           ` Dmitry A. Kazakov
2004-12-18 20:36             ` Warren W. Gay VE3WWG
2004-12-18 22:21               ` Dmitry A. Kazakov
2004-12-19  0:53                 ` Warren W. Gay VE3WWG
2004-12-19 12:21                   ` Dmitry A. Kazakov
2004-12-20  5:33                     ` Warren W. Gay VE3WWG
2004-12-20 20:01                       ` Dmitry A. Kazakov
2004-12-20 20:54                         ` Warren W. Gay VE3WWG
2004-12-14 22:40   ` Brian May
2004-12-15  3:23     ` Warren W. Gay VE3WWG [this message]
2004-12-15 15:01       ` Georg Bauhaus
2004-12-17  4:31         ` Brian May
2004-12-15 10:48   ` Brian May
2004-12-16  1:40     ` Brian May
2004-12-16  3:10       ` Warren W. Gay VE3WWG
2004-12-17  4:55         ` Brian May
2004-12-17 11:13           ` Warren W. Gay VE3WWG
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox