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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3ac0f9399164ca9f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Qt Ada database support? References: <0b27299b-c0ba-4592-a312-7192da923522@y7g2000yqa.googlegroups.com> From: Stephen Leake Date: Wed, 10 Jun 2009 06:37:57 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:9Jiid5ljazA1yBTxUQaETrmjIMw= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 089684a2f8cf4e9cadf9d16814 Xref: g2news2.google.com comp.lang.ada:6410 Date: 2009-06-10T06:37:57-04:00 List-Id: Ludovic Brenta writes: > Stephen Leake wrote on comp.lang.ada: >> I currently have a small database application, implemented using >> GtkAda and GNADE ODBC, using a MySQL backend. >> >> I'd like to switch to a direct connection to an SQLite3 database, >> mainly because the administration is much simpler. For example, I >> could not get an ODBC connection to a MySQL database installed, let >> alone working, on my Debian box (I currently have it working on >> Windows XP). The MySQL installation instructions are woefully out of >> date. >> >> The GNADE binding to SQLite3 is very minimal. I wouldn't mind very >> much improving it, but I'm investigating alternatives first. >> >> Does anyone know of an ODBC connector for SQLite3? Searching on >> Ask.com found: > [...] > > SQLite is merely a shared library that you link into your program; it > runs as part of your process. Yes. > There is no SQLite server and, as far as I know, no need for an ODBC > connection. If by "connection" we mean "sockets or something similar", then you are correct. But it would be possible to have an ODBC "wrapper", so the same ODBC API can be used. That's what I was looking for; that would be a _much_ smaller change to my code. Or a more ambitious system could run a process that accessed the SQLite database, and provided ODBC socket connections. That's _not_ what I'm looking for, of course :). > GNADE contains two bindings to SQLite: sqlite and sqlite3. The latter > is more complete but even sqlite seems sufficient to me because it > does not have or need the complexity of ODBC. It does lack the concept > of prepared statements, however; this is present in the sqlite3 > binding. > > Did you have some specific feature in mind? Cursors. Hmm. Maybe that's what the "Step" function is? I missed that on my first read thru. I expect to understand things just from reading Ada specs, but I guess I need to read the SQLite3 docs. Ah, here it is: http://www.sqlite.org/c3ref/step.html. And yes, that does what ODBC cursors do; access data tables one row at a time. That talks about a "new" prepare statement; apparently SQLite is a moving target. Sigh. It would be nice if GNADE had a database abstraction layer, so changing from MySQL to SQLite was more transparent. I think that's what the "ADO" packages were intended to be, but they are gone now. QtSQL is such a layer. I guess if I'm really ambitious I should port/translate QtSQL to a Gtk class GtkSQL, with GNADE backends. I'll at least think about it. Is anyone else interested in such a thing? Although the first step in such a project would be to actually use QtSQL, to be sure I really understand it, so I'd be tempted to stop after that :). Note that I have a bias towards Gtk over Qt. That's because I have a history with AdaCore (who maintain Gtk), and none with TrollTech (who maintain Qt). The Debian project supports both, but there seems to be a general preference for Gtk; Gnome is the default desktop, for instance. -- -- Stephe