comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: Ada DB bindings and APQ
Date: Wed, 15 Dec 2004 15:01:07 +0000 (UTC)
Date: 2004-12-15T15:01:07+00:00	[thread overview]
Message-ID: <cppjjj$cpt$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: 17Ovd.52$Wt5.33108@read2.cgocable.net

Warren W. Gay VE3WWG <ve3wwg@nospam.cogeco.ca> wrote:
: Brian May wrote:
 
 
:> 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.

I think its because the database name is actually a file name?
The example having 'hostspec:110//usr/db_file.db' may be similar.
Not sure either.

I've started writing a grammer, here is the
part for the first variant of the syntax. (It may have missed
the '//', and others of course.-)

Comments most welcome.  The start rule is named DSN.


Char -> mostly UTF-8 alphanumeric, in particular not on of []{}(),;?*=!@
          (as per Microsoft, but what to do withouth [] on VMS or
          Toronto file system?)

          (Char needs to be escaped in places. This is where the
          parser might become tricky. But we can count brackets,
	  and count implicitly (e.g., ':', '/').)

MSExcl -> '[' | ']' | '{' | '}' | '(' | ')'
MSExcl -> ',' | ';' | '?' | '*' | '=' | '!' | '@'

PWChar -> what characters are allowed in DBes? Can they include MSExcl

DBSpeak -> 'odbc', 'mysql', ...

DB -> 'mysql', 'psql', 'db2', 'sybase', 'solid',  ...

  (Note the ovelap of DBSpeak and DB)


Protocol -> 'tcp', 'p9', ...

Protocol_Opts -> TCP_Opts | P9_Opts | ...  (foreach in Protocol)

Host -> Hostname Opt_Port

Opt_Port -> ':' Port

Hostname -> IP | FQN

Port -> DIGIT DIGIT*    (how many digits max?)

IP -> an IP number, V4 or V6

FQN -> fully qualified host name

DBName -> Char Char*   (is this DB specific?)

UName -> Char Char*
      (is this restrictive? ':' in UName complicates.
      Are there DB systems allowing ':' in UName?)

PWord -> PWChar PWChar*



TCP_Opts -> Host

QSOptions -> '?' a query string as per CGI, for additional DB specific options
	   (note that '?' is excluded from Char)


The two Variants could either be treated separately, or we
could remember whether the variant syntax was used, and then
swith later. But the variant syntax seems to be simpler than
the "standard" one, in particular I see not QSOptions. So just
decide right at the beginning by the presence of '('...')' and
reuse components not at the grammar level, but at implementation
leven (if needed).


                ***   S T A R T   H E R E   ***

                ***        Standard         ***

DSN -> DB First_Colon


First_Colon -> ':' '//'         '/' DBName_Tail
First_Colon -> ':' '//' Server  '/' DBName_Tail
First_Colon -> ':' '//' U       '/' DBName_Tail

	    (There is overlap in Server and U, but as a minimum, we can
	     look ahead for required '@', implying U)

U -> UName Opt_PW '@' Server
Opt_PW -> ':' PWord

Server -> Host
Server -> Protocol '+' Host

       (again, look ahead for '+' before EOS or '/' or '?'.
       Can there be QSOptions without a preceding DBName?
       Check this anyway, a '+' in a QSOptions is not likely the right one)
       (hostnames may be named using names from DB!)


DBName_Tail -> '/' DBName QSOptions




             *** O R   S T A R T   H E R E ***


                ***   Variant syntax   ***


DSN -> DBSpeak '(' DB ')' ...






  reply	other threads:[~2004-12-15 15:01 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
2004-12-15 15:01       ` Georg Bauhaus [this message]
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