From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Ada package registry? Date: Sun, 7 Feb 2016 10:40:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <02241ec4-0f95-4f63-9abc-092f167eb59e@googlegroups.com> <56af17b7$0$301$14726298@news.sunsite.dk> <56b06eb8$0$301$14726298@news.sunsite.dk> <1454483747.2785.135.camel@obry.net> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 7 Feb 2016 09:37:20 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="29b8650774960281308dc95b48c0b0d7"; logging-data="1985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CdQ/VDLD9DbR8+WyFYPskIEq+eWogY2Y=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: Cancel-Lock: sha1:h+GWJmroHX+Iq3IL/gzX8HNB1WQ= Xref: news.eternal-september.org comp.lang.ada:29395 Date: 2016-02-07T10:40:13+01:00 List-Id: On 05.02.16 19:47, Dmitry A. Kazakov wrote: >> It is how SQL-invoked routines are being done, by definition. >> They are just written in languages other than Ada. > > There are DBMS servers and clients. Databases just have APIs, SQL databases have several kinds of APIs. As a programmer using some API, what you can program depends on the kind of API. It doesn't have to be "server" or "client". Similarly, the impossibility of all of the relational model within the Ada type system proper is interesting, but not so interesting if all you desperately want some easy, standard access to RDBMSs. In many cases, access to SQL databases is like access to the file system. It is a matter of course. Like directories. It has taken decades for Ada to get standard Directory access. Maybe Ada.Directories does not cover all of every file system ever invented. But, the package is being used, I understand, making Ada more viable, and practical. And real. Particular counterexamples just don't matter much: if one of Ada's standard packages does not purport to be universal, then it is like most business efforts. That's sufficient to get started. >> How would this be "not working"? > > type Timestamp is new Time; > pragma Convention (MySQL, Timestamp); -- Is it TIMESTAMP or YEAR? A SQL TIMESTAMP has enough description for it to be abstracted, for interfacing. By comparison, consider type Bits is mod System.Word_Size; type Pos is new Integer range 1 .. Integer'Last; Again, "not working"? Or perfectly normal? > type Decimal is delta 0.01 digits 10; > pragma Convention (MySQL, Decimal); -- DECIMAL (10, 2)? If C programmers get along with representing decimals in ad-hoc fashion, I don't see why Ada programmers should not store decimals of ready make types in databases, even when the RDBMS library requires some shielding, such as an instance of Unchecked_Conversion, or tackling the legacy of MySQL. -- "HOTDOGS ARE NOT BOOKMARKS" Springfield Elementary teaching staff