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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable 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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada package registry? Date: Fri, 5 Feb 2016 19:47:12 +0100 Organization: Aioe.org NNTP Server 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> NNTP-Posting-Host: LNA1TkTuMxfwTHzeJdi6nA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:29364 Date: 2016-02-05T19:47:12+01:00 List-Id: On 2016-02-05 18:58, G.B. wrote: > On 05.02.16 17:45, Dmitry A. Kazakov wrote: >> On 2016-02-05 16:53, G.B. wrote: >> >>> I mean "SQL-invoked routines", just the technical term of SQL. >>> ODBC is not necessarily involved, here. An Ada subprogram is being >>> called by the MS part of the DBMS, logically from within some >>> SQL statementent. As is done with stored procedures written in >>> SQL. E.g., when evaluating an expression, the DBMS passes database >>> values to an Ada function; when CALL-ing an Ada procedure, it >>> might expect the procedure to place a result into some IN OUT >>> parameter, or it might call the Ada procedure just for its effect. >> >> This is not how DB clients work. > > 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. Client API are constrained to be procedural rather than RA. Which is why subprgrams they define have little to do with RA operations and types involved. Ada's type system is not fit to provide with that regard something significantly better than C client API do. >> SQL types have parameters and depend on the RDBMS. This is not working >> either. > > We'd be talking about C types and UTFs, to cover the vast majority > of types used in all typical databases. That's a realistic > assumption. ISO/IEC 8652 addresses these. > > If needed, Interfaces.C provides a lot more already, > by defining how Ada implementations handle C structs, > such as geo points, and maybe enums. Most of the work is done by the pragma Convention. > How would this be "not working"? type Timestamp is new Time; pragma Convention (MySQL, Timestamp); -- Is it TIMESTAMP or YEAR? type Decimal is delta 0.01 digits 10; pragma Convention (MySQL, Decimal); -- DECIMAL (10, 2)? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de