[Gnome CVS User <gnomecvs cvs gnome org>] GNOME CVS: libgda rodrigo



Hi all!

I've just checked in the changes needed for supporting the CommandType
attribute in GDA::Command objects. What I've done is:

1) "create" new enum type in IDL:
enum CommandType {
		COMMAND_TYPE_TEXT,
		COMMAND_TYPE_TABLE,
		COMMAND_TYPE_TABLEDIRECT,
		COMMAND_TYPE_STOREDPROCEDURE,
		COMMAND_TYPE_FILE
	};
I'll add a COMMAND_TYPE_XML soon.
2) changed type attribute in GDA::Command: it was a unsigned long, now
it's a GDA_CommandType
3) changes all over to adapt to new attribute type (BTW, by making this
change, I found a bug in the (I think) 0.2.1 released version, which was
that I forgot to add a pointer to a function in an ORBit structure, and
thus the following function pointers in the structure were displaced, so
there were some CORBA exceptions when executing some CORBA calls. Has
anybody experienced this?

So now, you can:
gda_command_set_cmd_type(GDA_COMMAND(cmd), GDA_COMMAND_TYPE_TABLE);

By default, providers' GDA::Command will have the CmdType set to TEXT
(== SQL or whatever language is used). But now, we must adapt/extend the
providers to support this new feature. As a first measure, we must, in
gda_*_command_execute, add a switch like:

switch (gda_server_command_get_cmd_type(cmd)) {
      case GDA_COMMAND_TYPE_TEXT : -> execute SQL as now
      case GDA_COMMAND_TYPE_TABLE : -> return a SELECT * FROM $table
      case GDA_COMMAND_TYPE_STOREDPROCEDURE : -> exec procedure
      case GDA_COMMAND_TYPE_FILE : -> load file and execute
}

So please, Vivien, Nick, Holger, can you update your providers? I'll do
the others. The switch is needed only in gda-*-command.c, in the
gda_*_command_execute function. For the moment, just respond to the
TYPE_TEXT command type, or, if you feel like doing it, implement the
other ones.

cheers

Forwarded message:
> CVSROOT:      /cvs/gnome
> Module name:  libgda
> Changes by:   rodrigo 00/12/21 12:20:57
> 
> Modified files:
>       .              : ChangeLog 
>       bindings/c++   : gdaCommand.cpp gdaCommand.h gdaConnection.cpp 
>                        gdaConnection.h 
>       idl            : GDA.idl GDA_Command.idl GDA_Connection.idl 
>       lib/gda-client : gda-command.c gda-command.h gda-connection.c 
>                        gda-connection.h 
>       lib/gda-server : gda-server-command.c gda-server-impl-command.c 
>                        gda-server-impl-command.h 
>                        gda-server-impl-connection.c 
>                        gda-server-impl-connection.h gda-server-impl.h 
> 
> Log message:
> 2000-12-21    Rodrigo Moya <rodrigo gnome-db org>
> 
> * added support for the GDA_CommandType stuff, which will
> allow to treat commands in different ways (SQL, TABLE,
> XML, etc)
> 
> 
> _______________________________________________
> cvs-commits-list mailing list
> cvs-commits-list gnome org
> http://mail.gnome.org/mailman/listinfo/cvs-commits-list
> 





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