Command

The GdaCommand structure holds data needed to issue a command to the providers. Applications usually create a GdaCommand (via gda_command_new), set its properties (via the gda_command_set_* functions) and pass it over to the database using the GdaConnection functions.

One interesting thing about GdaCommand's is that they can be reused over and over. That is, applications don't need to create a command every time they want to run something on the connected database. Moreover, the ability to create command strings with placeholders allows the use of parameters to specify the values for those placeholders. Thus, an application can create a command of the form:

INSERT INTO employees VALUES (id, name, address, salary)

and reuse the same command over and over, just using different values for the placeholders.

The value for the placeholders is specified when sending the GdaCommand to a database connection, which is done via the gda_connection_execute function.

Constructors

this
this(GdaCommand* gdaCommand)

Sets our main struct and passes it to the parent class

this
this(string 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.

Members

Functions

copy
Command copy()

Creates a new GdaCommand from an existing one.

free
void free()

Frees the resources allocated by gda_command_new.

getCommandStruct
GdaCommand* getCommandStruct()

Get the main Gtk struct

getCommandType
GdaCommandType getCommandType()

Gets the command type of cmd.

getOptions
GdaCommandOptions getOptions()

Gets the command options of cmd.

getStruct
void* getStruct()

the main Gtk struct as a void*

getText
string getText()

Gets the command text held by cmd.

getTransaction
Transaction getTransaction()

Gets the GdaTransaction associated with the given GdaCommand.

setCommandType
void setCommandType(GdaCommandType type)

Sets the command type of cmd.

setOptions
void setOptions(GdaCommandOptions options)

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

setText
void setText(string text)

Sets the command text of cmd.

setTransaction
void setTransaction(Transaction xaction)

Sets the GdaTransaction associated with the given GdaCommand.

Static functions

getType
GType getType()

Variables

gdaCommand
GdaCommand* gdaCommand;

the main Gtk struct

Meta