gda-command

Name

gda-command -- Functions that deal with GdaCommand.

Synopsis



typedef     GdaCommand;
typedef     GdaCommandOptions;
#define     GDA_COMMAND_OPTION_IGNORE_ERRORS
#define     GDA_COMMAND_OPTION_STOP_ON_ERRORS
#define     GDA_COMMAND_OPTION_BAD_OPTION
#define     GDA_COMMAND_DEFAULT_OPTION
enum        GdaCommandType;
GdaCommand* gda_command_new                 (const gchar *text,
                                             GdaCommandType type,
                                             GdaCommandOptions options);
void        gda_command_free                (GdaCommand *cmd);
const gchar* gda_command_get_text           (GdaCommand *cmd);
void        gda_command_set_text            (GdaCommand *cmd,
                                             const gchar *text);
GdaCommandType gda_command_get_command_type (GdaCommand *cmd);
void        gda_command_set_command_type    (GdaCommand *cmd,
                                             GdaCommandType type);
GdaCommandOptions gda_command_get_options   (GdaCommand *cmd);
void        gda_command_set_options         (GdaCommand *cmd,
                                             GdaCommandOptions options);

Description

The GdaCommand structure holds data needed to issue a command to the providers.

Details

GdaCommand

typedef GNOME_Database_Command GdaCommand;


GdaCommandOptions

typedef GNOME_Database_CommandOptions GdaCommandOptions;

And OR'ed combination of GDA_COMMAND_OPTIONS_* values.


GDA_COMMAND_OPTION_IGNORE_ERRORS

#define GDA_COMMAND_OPTION_IGNORE_ERRORS  GNOME_Database_IGNORE_ERRORS

Instruct the provider to ignore errors in the execution of commands and continue processing. Conflicts with GDA_COMMAND_OPTION_STOP_ON_ERRORS.


GDA_COMMAND_OPTION_STOP_ON_ERRORS

#define GDA_COMMAND_OPTION_STOP_ON_ERRORS GNOME_Database_STOP_ON_ERRORS

Instruct the provider to stop in case of error when executing commands. The provider should add an error to the connection and return NULL. Conflicts with GDA_COMMAND_OPTION_IGNORE_ERRORS.


GDA_COMMAND_OPTION_BAD_OPTION

#define GDA_COMMAND_OPTION_BAD_OPTION     GNOME_Database_BAD_OPTION

Returned value for gda_command_get_option if the argument is NULL.


GDA_COMMAND_DEFAULT_OPTION

#define GDA_COMMAND_DEFAULT_OPTION        GNOME_Database_DEFAULT_OPTION

This value is the one set by default. Currently is equal to GDA_COMMAND_OPTION_STOP_ON_ERRORS.


enum GdaCommandType

typedef enum {
	GDA_COMMAND_TYPE_SQL = GNOME_Database_COMMAND_TYPE_SQL,
	GDA_COMMAND_TYPE_XML = GNOME_Database_COMMAND_TYPE_XML,
	GDA_COMMAND_TYPE_PROCEDURE = GNOME_Database_COMMAND_TYPE_PROCEDURE,
	GDA_COMMAND_TYPE_TABLE = GNOME_Database_COMMAND_TYPE_TABLE,
	GDA_COMMAND_TYPE_INVALID = GNOME_Database_COMMAND_TYPE_INVALID
} GdaCommandType;

GDA_COMMAND_TYPE_SQLthe text of the command is composed of zero or more SQL sentences.
GDA_COMMAND_TYPE_XML 
GDA_COMMAND_TYPE_PROCEDURE 
GDA_COMMAND_TYPE_TABLEthe text of the command is composed of zero or more table names.
GDA_COMMAND_TYPE_INVALID 


gda_command_new ()

GdaCommand* gda_command_new                 (const gchar *text,
                                             GdaCommandType type,
                                             GdaCommandOptions options);

Creates a new GdaCommand from the parameters that should be freed by calling gda_command_free.

If there are conflicting options, this will set options to GDA_COMMAND_OPTION_DEFAULT.

text : the text of the command.
type : a GdaCommandType value.
options : a GdaCommandOptions value.
Returns : a newly allocated GdaCommand.


gda_command_free ()

void        gda_command_free                (GdaCommand *cmd);

Frees the resources allocated by gda_command_new.

cmd : a GdaCommand.


gda_command_get_text ()

const gchar* gda_command_get_text           (GdaCommand *cmd);

Get the command text held by cmd.

cmd : a GdaCommand.
Returns : the command string of cmd.


gda_command_set_text ()

void        gda_command_set_text            (GdaCommand *cmd,
                                             const gchar *text);

Sets the command text of cmd.

cmd : a GdaCommand
text : the command text.


gda_command_get_command_type ()

GdaCommandType gda_command_get_command_type (GdaCommand *cmd);

Gets the command type of cmd.

cmd : a GdaCommand.
Returns : the command type of cmd.


gda_command_set_command_type ()

void        gda_command_set_command_type    (GdaCommand *cmd,
                                             GdaCommandType type);

Sets the command type of cmd.

cmd : a GdaCommand
type : the command type.


gda_command_get_options ()

GdaCommandOptions gda_command_get_options   (GdaCommand *cmd);

Gets the command options of cmd.

cmd : a GdaCommand.
Returns : the command options of cmd.


gda_command_set_options ()

void        gda_command_set_options         (GdaCommand *cmd,
                                             GdaCommandOptions options);

Sets the command options of cmd. If there conflicting options, it will just leave the value as before.

cmd : a GdaCommand
options : the command options.