Re: [gnome-db] Re: question: in memory table representation: please help



On Tue, 2 Nov 2004 17:11:16 +0100, Vivien Malerba <vmalerba gmail com> wrote:
> On Sun, 31 Oct 2004 18:56:35 -0700, Neil Zanella <nzanella gmail com> wrote:
> [...]
> 
> 
> >
> > > Mergeant provides the envoriment to develop the databases, relationships
> > > etc.
> >
> > As a matter of fact, I have already designed some databases but would like
> > to use mergeant. It just seems neater. Mergeant does for me what I have been
> > doing by hand.
> >
> > Eventually though, I want to make it possible to create my database from
> > my GTK+ code. I don't know whether mergeant has this already. So here is
> > my suggestion for mergeant: a feature that does what libglade did to glade.
> > Allow the user to save the database tables into an XML file and load their
> > structure at runtime so that the whole database structure can be
> > instantiated from C code. Perhaps it's already there, not sure.
> > As soon as I can get the CVS version to compile I will test it.
> 
> 
> Libmergeant (upon which Mergeant is built)has a data dictionnary
> (saved in a .xml file with a well defined DTD) for each connection to
> a database. Upon loading the XML file, the dictionnary contains a list
> of MgDbTable objects which represent the tables described in the XML
> file (basically each table is a list of fields and has some
> constraints).

Basically, each user is going to be connecting to different databases,
so the database connection XML files need to be user defined connections
stored under /home given that they are implemented. The DTD files however,
in my case and many others, need to be system files, only writable by the
superuser and simply readable by others. So we need two files here for
security reasons.

> The missing code is to translate a MgDbTable object into a SQL
> statement to create the table (CREATE TABLE...) or update its
> structure (ALTER TABLE...).
> 
> I plan to add these features after the merger with libgnomedb: from
> what I have understood from your first messages, you want that
> feature.

It would be a nice feature. It helps recreate the database from scratch.
Especially since I am also going to allow users to export data as INSERT
statements. This is for maximum portability.

> If the feature you want is simply generating the INSERT/UPDATE/DELETE
> statements to insert/update/delete data from that table, then
> Libmergeant has an object to do that and it already works (the API to
> access it will be changed to use the generic GdaDataModel interface).

That's cool, but can I make the file containing the SQL schema description
a system file rather than a user file (i.e. a file shared by all users
on my system).
I think it's not to hard, just that I don't know if it's implemented
at this stage.

Also, you merging with gnome-db and not with libgda. Now that gnome-db has a
Makefile for windows (which I presume works), it doesn't matter much I suppose
but if there's anything GUI about your code which is not going to run on windows
then I suggest integrating the library part with libgda (or gnome-db),
and leaving
the rest as a separate compatible module.

I would also like to know if your library compiles on win32 at present
and what CVS commands to issue to check out the library.

Thanks!

Neil



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