Inherits Glib::Object.
Public Member Functions | |
virtual | ~SqlBuilder () |
GdaSqlBuilder* | gobj () |
Provides access to the underlying C GObject. | |
const GdaSqlBuilder* | gobj () const |
Provides access to the underlying C GObject. | |
GdaSqlBuilder* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< Statement > | get_statement () const |
SqlStatement | get_sql_statement () const |
guint | add_id (const Glib::ustring&string) |
Defines an expression which may be reused to build other parts of a statement. | |
template<class ValueType > | |
guint | add_expr (const Glib::RefPtr< DataHandler >& dh, const ValueType&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
guint | add_expr_as_value (const Glib::RefPtr< DataHandler >& dh, const Value&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
template<class ValueType > | |
guint | add_expr (const ValueType&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
guint | add_expr_as_value (const Value&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
guint | add_param (const Glib::ustring& param_name, GType type, bool nullok=false) |
Defines a parameter which may be reused to build other parts of a statement. | |
guint | add_cond (SqlOperatorType op, guint op1, guint op2=0, guint op3=0) |
Builds a new expression which reprenents a condition (or operation). | |
guint | add_cond (SqlOperatorType op, const Glib::ArrayHandle< guint >& op_ids) |
Builds a new expression which reprenents a condition (or operation). | |
guint | add_function (const Glib::ustring& function_name, const Glib::ArrayHandle< guint >& args) |
Builds a new expression which represents a function applied to some arguments. | |
guint | add_function (const Glib::ustring& function_name, guint arg) |
Builds a new expression which represents a function applied to an argument. | |
guint | add_sub_select (const SqlStatement& sqlst) |
guint | select_add_field (const Glib::ustring& field_name, const Glib::ustring& table_name, const Glib::ustring& alias=Glib::ustring()) |
guint | select_add_target (const Glib::ustring& table_name, const Glib::ustring& alias=Glib::ustring()) |
Adds a new target to a SELECT statement. | |
guint | select_add_target_id (guint table_id, const Glib::ustring& alias=Glib::ustring()) |
guint | select_join_targets (guint left_target_id, guint right_target_id, SqlSelectJoinType join_type, guint join_expr=0) |
Joins two targets in a SELECT statement. | |
void | join_add_field (guint join_id, const Glib::ustring& field_name) |
void | select_order_by (guint expr_id, bool asc=true, const Glib::ustring& collation_name=Glib::ustring()) |
void | select_set_distinct (bool distinct=true) |
Adds or removes a DISTINCT clause for a SELECT statement. | |
void | select_set_distinct (bool distinct, guint expr_id) |
void | select_set_limit (guint limit_count, guint offset=0) |
Defines the maximum number of rows in the DataModel resulting from the execution of the built statement. | |
void | select_set_limit_id (guint limit_count_expr_id, guint limit_offest_expr_id=0) |
void | select_set_having (guint cond_id) |
void | select_group_by (guint expr_id) |
void | set_table (const Glib::ustring& table_name) |
void | set_where (guint cond_id) |
void | add_field_id (guint field_id, guint value_id=0) |
template<class ValueType > | |
void | add_field_value (const Glib::ustring& field_name, const ValueType&value) |
void | add_field_value_as_value (const Glib::ustring& field_name, const Value&value) |
void | compound_add_sub_select (const SqlStatement& sqlst) |
SqlExpr | export_expression (guint id) const |
guint | import_expression (const SqlExpr& expr) |
Static Public Member Functions | |
static Glib::RefPtr< SqlBuilder > | create (SqlStatementType type) |
Protected Member Functions | |
SqlBuilder (SqlStatementType type) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gnome::Gda::SqlBuilder > | wrap (GdaSqlBuilder* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
virtual Gnome::Gda::SqlBuilder::~SqlBuilder | ( | ) | [virtual] |
Gnome::Gda::SqlBuilder::SqlBuilder | ( | SqlStatementType | type | ) | [protected] |
guint Gnome::Gda::SqlBuilder::add_cond | ( | SqlOperatorType | op, | |
const Glib::ArrayHandle< guint > & | op_ids | |||
) |
Builds a new expression which reprenents a condition (or operation).
op | Type of condition | |
op_ids,: | list of IDs of the operands of the condition |
guint Gnome::Gda::SqlBuilder::add_cond | ( | SqlOperatorType | op, | |
guint | op1, | |||
guint | op2 = 0 , |
|||
guint | op3 = 0 | |||
) |
Builds a new expression which reprenents a condition (or operation).
op | Type of condition | |
op1 | The ID of the 1st argument (not 0) | |
op2 | The ID of the 2st argument (maybe 0 if op only requires one argument) | |
op3 | The ID of the 3st argument (maybe 0 if op only requires one or two arguments) |
guint Gnome::Gda::SqlBuilder::add_expr | ( | const ValueType & | value | ) | [inline] |
Defines an expression in Builder which may be reused to build other parts of a statement.
value,: | value to set the expression to |
See expr() except that no custom datahandler is given
guint Gnome::Gda::SqlBuilder::add_expr | ( | const Glib::RefPtr< DataHandler >& | dh, | |
const ValueType & | value | |||
) | [inline] |
Defines an expression in Builder which may be reused to build other parts of a statement.
dh | The datahandler to use | |
value,: | value to set the expression to |
See expr() except that no custom datahandler is given
guint Gnome::Gda::SqlBuilder::add_expr_as_value | ( | const Value& | value | ) |
Defines an expression in Builder which may be reused to build other parts of a statement.
value,: | value to set the expression to |
See expr() except that no custom datahandler is given
guint Gnome::Gda::SqlBuilder::add_expr_as_value | ( | const Glib::RefPtr< DataHandler >& | dh, | |
const Value& | value | |||
) |
Defines an expression in Builder which may be reused to build other parts of a statement.
dh | The datahandler to use | |
value,: | value to set the expression to |
See expr() except that no custom datahandler is given
void Gnome::Gda::SqlBuilder::add_field_id | ( | guint | field_id, | |
guint | value_id = 0 | |||
) |
void Gnome::Gda::SqlBuilder::add_field_value | ( | const Glib::ustring & | field_name, | |
const ValueType & | value | |||
) | [inline] |
void Gnome::Gda::SqlBuilder::add_field_value_as_value | ( | const Glib::ustring & | field_name, | |
const Value& | value | |||
) |
guint Gnome::Gda::SqlBuilder::add_function | ( | const Glib::ustring & | function_name, | |
guint | arg | |||
) |
Builds a new expression which represents a function applied to an argument.
function_name | The name of the function to embed (e.g. MAX, MIN, ...) | |
arg,: | The ids of the argument to the function |
guint Gnome::Gda::SqlBuilder::add_function | ( | const Glib::ustring & | function_name, | |
const Glib::ArrayHandle< guint > & | args | |||
) |
Builds a new expression which represents a function applied to some arguments.
function_name | The name of the function to embed (e.g. MAX, MIN, ...) | |
args,: | list of ids of the arguments to the function |
guint Gnome::Gda::SqlBuilder::add_id | ( | const Glib::ustring & | string | ) |
Defines an expression which may be reused to build other parts of a statement.
string | String to use in the SQL |
guint Gnome::Gda::SqlBuilder::add_param | ( | const Glib::ustring & | param_name, | |
GType | type, | |||
bool | nullok = false | |||
) |
Defines a parameter which may be reused to build other parts of a statement.
param_name: name of the parameter : GType of the parameter True if the parameter can be set to NULL |
guint Gnome::Gda::SqlBuilder::add_sub_select | ( | const SqlStatement& | sqlst | ) |
void Gnome::Gda::SqlBuilder::compound_add_sub_select | ( | const SqlStatement& | sqlst | ) |
static Glib::RefPtr<SqlBuilder> Gnome::Gda::SqlBuilder::create | ( | SqlStatementType | type | ) | [static] |
SqlExpr Gnome::Gda::SqlBuilder::export_expression | ( | guint | id | ) | const |
SqlStatement Gnome::Gda::SqlBuilder::get_sql_statement | ( | ) | const |
Glib::RefPtr<Statement> Gnome::Gda::SqlBuilder::get_statement | ( | ) | const |
const GdaSqlBuilder* Gnome::Gda::SqlBuilder::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
GdaSqlBuilder* Gnome::Gda::SqlBuilder::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase.
GdaSqlBuilder* Gnome::Gda::SqlBuilder::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
guint Gnome::Gda::SqlBuilder::import_expression | ( | const SqlExpr& | expr | ) |
void Gnome::Gda::SqlBuilder::join_add_field | ( | guint | join_id, | |
const Glib::ustring & | field_name | |||
) |
guint Gnome::Gda::SqlBuilder::select_add_field | ( | const Glib::ustring & | field_name, | |
const Glib::ustring & | table_name, | |||
const Glib::ustring & | alias = Glib::ustring() | |||
) |
guint Gnome::Gda::SqlBuilder::select_add_target | ( | const Glib::ustring & | table_name, | |
const Glib::ustring & | alias = Glib::ustring() | |||
) |
Adds a new target to a SELECT statement.
table_id | The ID of the expression holding a table reference. | |
alias | The alias to give to the target. |
guint Gnome::Gda::SqlBuilder::select_add_target_id | ( | guint | table_id, | |
const Glib::ustring & | alias = Glib::ustring() | |||
) |
void Gnome::Gda::SqlBuilder::select_group_by | ( | guint | expr_id | ) |
guint Gnome::Gda::SqlBuilder::select_join_targets | ( | guint | left_target_id, | |
guint | right_target_id, | |||
SqlSelectJoinType | join_type, | |||
guint | join_expr = 0 | |||
) |
Joins two targets in a SELECT statement.
left_target_id | The ID of the left target to use (not 0) | |
right_target_id | The ID of the right target to use (not 0) | |
join_type | The type of join | |
join_expr | Joining expression's ID, or 0 |
void Gnome::Gda::SqlBuilder::select_order_by | ( | guint | expr_id, | |
bool | asc = true , |
|||
const Glib::ustring & | collation_name = Glib::ustring() | |||
) |
void Gnome::Gda::SqlBuilder::select_set_distinct | ( | bool | distinct, | |
guint | expr_id | |||
) |
void Gnome::Gda::SqlBuilder::select_set_distinct | ( | bool | distinct = true |
) |
Adds or removes a DISTINCT clause for a SELECT statement.
distinct | Whether a DISTINCT clause should be in the SELECT statement. |
void Gnome::Gda::SqlBuilder::select_set_having | ( | guint | cond_id | ) |
void Gnome::Gda::SqlBuilder::select_set_limit | ( | guint | limit_count, | |
guint | offset = 0 | |||
) |
Defines the maximum number of rows in the DataModel resulting from the execution of the built statement.
limit_count | The number of rows that should be returned. | |
The | offset of the first row that should appear in the result. (note that this feature may not be supported by all the database providers.) |
void Gnome::Gda::SqlBuilder::select_set_limit_id | ( | guint | limit_count_expr_id, | |
guint | limit_offest_expr_id = 0 | |||
) |
void Gnome::Gda::SqlBuilder::set_table | ( | const Glib::ustring & | table_name | ) |
void Gnome::Gda::SqlBuilder::set_where | ( | guint | cond_id | ) |
Glib::RefPtr< Gnome::Gda::SqlBuilder > wrap | ( | GdaSqlBuilder * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |