Inherits Glib::Object.
Public Types | |
typedef guint | Id |
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 |
Id | add_id (const Glib::ustring&string) |
Id | add_field_id (const Glib::ustring& field_name, const Glib::ustring& table_name=Glib::ustring()) |
template<class ValueType > | |
Id | 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. | |
Id | 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 > | |
Id | add_expr (const ValueType&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
Id | add_expr_as_value (const Value&value) |
Defines an expression in Builder which may be reused to build other parts of a statement. | |
Id | 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. | |
Id | add_cond (SqlOperatorType op, Id op1, Id op2=0, Id op3=0) |
Builds a new expression which reprenents a condition (or operation). | |
Id | add_cond (SqlOperatorType op, const Glib::ArrayHandle< Id >& op_ids) |
Builds a new expression which reprenents a condition (or operation). | |
Id | add_function (const Glib::ustring& function_name, const Glib::ArrayHandle< Id >& args) |
Builds a new expression which represents a function applied to some arguments. | |
Id | add_function (const Glib::ustring& function_name, Id arg) |
Builds a new expression which represents a function applied to an argument. | |
Id | add_sub_select (const SqlStatement& sqlst) |
Id | select_add_field (const Glib::ustring& field_name, const Glib::ustring& table_name, const Glib::ustring& alias=Glib::ustring()) |
Id | select_add_target (const Glib::ustring& table_name, const Glib::ustring& alias=Glib::ustring()) |
Adds a new target to a SELECT statement. | |
Id | select_add_target_id (Id table_id, const Glib::ustring& alias=Glib::ustring()) |
Id | select_join_targets (Id left_target_id, Id right_target_id, SqlSelectJoinType join_type, Id join_expr=0) |
Joins two targets in a SELECT statement. | |
void | join_add_field (Id join_id, const Glib::ustring& field_name) |
void | select_order_by (Id 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, Id expr_id) |
void | select_set_limit (Id limit_count, Id offset=0) |
Defines the maximum number of rows in the DataModel resulting from the execution of the built statement. | |
void | select_set_limit_id (Id limit_count_expr_id, Id limit_offest_expr_id=0) |
void | select_set_having (Id cond_id) |
void | select_group_by (Id expr_id) |
void | set_table (const Glib::ustring& table_name) |
void | set_where (Id cond_id) |
void | add_field_value_id (Id field_id, Id 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 (Id id) const |
Id | 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. |
typedef guint Gnome::Gda::SqlBuilder::Id |
virtual Gnome::Gda::SqlBuilder::~SqlBuilder | ( | ) | [virtual] |
Gnome::Gda::SqlBuilder::SqlBuilder | ( | SqlStatementType | type | ) | [protected] |
Id Gnome::Gda::SqlBuilder::add_cond | ( | SqlOperatorType | op, | |
const Glib::ArrayHandle< Id >& | 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 |
Id Gnome::Gda::SqlBuilder::add_cond | ( | SqlOperatorType | op, | |
Id | op1, | |||
Id | op2 = 0 , |
|||
Id | 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) |
Id 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
Id 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
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
Id 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
Id Gnome::Gda::SqlBuilder::add_field_id | ( | const Glib::ustring & | field_name, | |
const Glib::ustring & | table_name = Glib::ustring() | |||
) |
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 | |||
) |
Id Gnome::Gda::SqlBuilder::add_function | ( | const Glib::ustring & | function_name, | |
Id | 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 |
Id Gnome::Gda::SqlBuilder::add_function | ( | const Glib::ustring & | function_name, | |
const Glib::ArrayHandle< Id >& | 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 |
Id Gnome::Gda::SqlBuilder::add_id | ( | const Glib::ustring & | string | ) |
Id 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 |
Id 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] |
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.
void Gnome::Gda::SqlBuilder::join_add_field | ( | Id | join_id, | |
const Glib::ustring & | field_name | |||
) |
Id Gnome::Gda::SqlBuilder::select_add_field | ( | const Glib::ustring & | field_name, | |
const Glib::ustring & | table_name, | |||
const Glib::ustring & | alias = Glib::ustring() | |||
) |
Id 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. |
Id Gnome::Gda::SqlBuilder::select_add_target_id | ( | Id | table_id, | |
const Glib::ustring & | alias = Glib::ustring() | |||
) |
void Gnome::Gda::SqlBuilder::select_group_by | ( | Id | expr_id | ) |
Id Gnome::Gda::SqlBuilder::select_join_targets | ( | Id | left_target_id, | |
Id | right_target_id, | |||
SqlSelectJoinType | join_type, | |||
Id | 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 | ( | Id | expr_id, | |
bool | asc = true , |
|||
const Glib::ustring & | collation_name = Glib::ustring() | |||
) |
void Gnome::Gda::SqlBuilder::select_set_distinct | ( | bool | distinct, | |
Id | 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 | ( | Id | cond_id | ) |
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 | ( | Id | limit_count_expr_id, | |
Id | limit_offest_expr_id = 0 | |||
) |
void Gnome::Gda::SqlBuilder::set_table | ( | const Glib::ustring & | table_name | ) |
void Gnome::Gda::SqlBuilder::set_where | ( | Id | 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. |