[gnome-db] gnome-db and complete C/GTK support for SQL DDL???



Hello people,

----------------------------------------------------------------

Summary: I need an API that will let me
define tables in C/GTK in an OO manner, write
the corresponding CREATE statements in
SQL, retrieve metadata about those statemnts
in C/GTK, allow me to subclass tables to define
what needs to be done on inserts, updates, etc...
to other tables (foreign keys would have built
in handles to other table types).

So, does gda provide me with this too, or am I
just about to code all of this myself from scratch
and make my own library for this?

Thanks,

Neil

------------------------------------------------------------------

Let me explain to me my problem. Consider a database with many
interrelated tables.
There are some issues involved with such an application that deserve
some comments.

   Tables have data types. The issue of mapping GTK/C data types to
SQL data types
    is seemingly complex because of cross vendor variations. It seems
like somehow
    libgda should provide middleware that allows the user to enter
data compatible with
    the one described by the provider. Moreover, it seems to me that
it should make it
    possible to define tables right there, without having to compose
strings containing
    CREATE TABLE statements...

    Basically, I should be able to create a database object, add
database table objects
    to such an object, and then issue a call datbase->create() which
iterates through all
    table objects and creates them right there.

    Each table object described above should be a member of an SQLTable calss.
    Each SQLTable instance should have member functions that allow you to query
    stuff like what rows does this table have?, what are the names of the column
    hearders?, what is the name of the table? what is its primary key? what are
    its foreign keys? what are the unique keys? what are the check constraints?
    can we describe the triggers associated with these tables (ok, this latter
    question leads to some complexities, so I will drop it, the one concerning
    triggers that is)?

    Why all this? For a simple reason: I want to execute some generic
code, like:

    I've got this tuple object. I don't know what table I'm looking
at, but I want to
    insert this tuple. Please check the primary key.

    See, this kind of generic programming can be useful for large databases.

So, I want to do stuff like this (want more examples, just ask of
generic programming
in the context of databases?) My question is does libgda do this
already? Cause if
not I will end up writing a library to support this myself in the next
timeframe. It
seems to me that libgda should let me do this kind of stuff:

define tables in C
write them out in SQL
query their metadata in C

Furthermore, PostgreSQL, Oracle, and so on, each have their own PL/SQL or
whatever, and they are incompatible, so triggers and doing updates on tables
C and D automatically when A is updated need be done in source code for
maximum portability.

Comments on all or any of the above EXTREMELY welcome,

Thanks!!

Neil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]