From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Qt Ada database support?
Date: Wed, 10 Jun 2009 06:37:57 -0400
Date: 2009-06-10T06:37:57-04:00 [thread overview]
Message-ID: <uljo0tlve.fsf@stephe-leake.org> (raw)
In-Reply-To: 0b27299b-c0ba-4592-a312-7192da923522@y7g2000yqa.googlegroups.com
Ludovic Brenta <ludovic@ludovic-brenta.org> 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
next prev parent reply other threads:[~2009-06-10 10:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 11:30 Qt Ada database support? Stephen Leake
2009-06-09 12:22 ` Vadim Godunko
2009-06-10 10:10 ` Stephen Leake
2009-06-09 12:30 ` Ludovic Brenta
2009-06-10 10:37 ` Stephen Leake [this message]
2009-06-10 10:45 ` Qt vs. GTK+ (was: Qt Ada database support?) Ludovic Brenta
2009-06-10 14:00 ` Vadim Godunko
2009-06-10 10:49 ` Qt Ada database support? Ludovic Brenta
2009-06-11 10:26 ` Stephen Leake
2009-06-09 13:06 ` Maciej Sobczak
2009-06-10 10:45 ` Stephen Leake
2009-06-10 13:27 ` Maciej Sobczak
2009-06-11 10:28 ` Stephen Leake
2009-06-11 10:32 ` Ludovic Brenta
2009-06-12 10:41 ` Stephen Leake
2009-06-12 10:48 ` Ludovic Brenta
2009-06-11 16:58 ` Emmanuel Briot
2009-06-11 20:37 ` Status of GNADE (Was: Qt Ada database support?) Tomek Wałkuski
2009-06-12 11:01 ` Status of GNADE Stephen Leake
2009-06-12 10:54 ` Qt Ada database support? Stephen Leake
2009-06-12 13:34 ` Ludovic Brenta
2009-06-11 23:06 ` GNADE, ODBC and MySQL Björn Persson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox