SqlBuilder
Object Hierarchy:
Description:
Namespace: Gda
Package: libgda-6.0
Content:
Static methods:
- public static Quark error_quark ()
Creation methods:
- public SqlBuilder (SqlStatementType stmt_type)
Create a new SqlBuilder object to build Statement or SqlStatement objects of type
stmt_type
Methods:
- public SqlBuilderId add_case_v (SqlBuilderId test_expr, SqlBuilderId else_expr, SqlBuilderId[] when_array, SqlBuilderId[] then_array)
Creates a new CASE ... WHEN ... THEN ... ELSE ... END expression.
- public SqlBuilderId add_cond (SqlOperatorType op, SqlBuilderId op1, SqlBuilderId op2, SqlBuilderId op3)
Builds a new expression which represents a condition (or operation).
- public SqlBuilderId add_cond_v (SqlOperatorType op, SqlBuilderId[] op_ids)
Builds a new expression which represents a condition (or operation).
- public SqlBuilderId add_expr_value (Value? value)
Defines an expression in this which may be reused to build other parts of a statement.
- public SqlBuilderId add_field_id (string field_name, string? table_name = null)
Defines an expression representing a field in this, which may be reused to build other parts of a statement, for instance as a parameter to add_cond or add_field_value_id.
- public void add_field_value_as_gvalue (string field_name, Value? value)
Valid only for: INSERT, UPDATE statements.
- public void add_field_value_id (SqlBuilderId field_id, SqlBuilderId value_id)
Valid only for: INSERT, UPDATE, SELECT statements <itemizedlist> < listitem><para>For UPDATE: specifies that the field represented by
field_id
will be set to the value identified byvalue_id
. - public SqlBuilderId add_function_v (string func_name, SqlBuilderId[] args)
Builds a new expression which represents a function applied to some arguments
- public SqlBuilderId add_id (string str)
Defines an expression representing an identifier in this, which may be reused to build other parts of a statement, for instance as a parameter to add_cond or add_field_value_id.
- public SqlBuilderId add_param (string param_name, Type type, bool nullok)
Defines a parameter in this which may be reused to build other parts of a statement.
- public SqlBuilderId add_sub_select (SqlStatement sqlst)
Adds an expression which is a subselect.
- public void compound_add_sub_select (SqlStatement sqlst)
Add a sub select to a COMPOUND statement
- public void compound_add_sub_select_from_builder (SqlBuilder subselect)
Add a sub select to a COMPOUND statement
- public void compound_set_type (SqlStatementCompoundType compound_type)
Changes the type of compound which this is making, for a COMPOUND statement
- public SqlExpr export_expression (SqlBuilderId id)
Exports a part managed by this as a new SqlExpr, which can represent any expression in a statement.
- public unowned SqlStatement? get_sql_statement ()
Creates a new SqlStatement structure from this's contents.
- public Statement get_statement () throws Error
Creates a new Statement statement from this's contents.
- public SqlBuilderId import_expression (SqlExpr expr)
Imports the
expr
into this. - public SqlBuilderId import_expression_from_builder (SqlBuilder query, SqlBuilderId expr_id)
Imports the an expression located in
query
into this. - public void join_add_field (SqlBuilderId join_id, string field_name)
Alter a join in a SELECT statement to make its condition use equal field values in the fields named
field_name
in both tables, via the USING keyword. - public SqlBuilderId select_add_field (string field_name, string? table_name = null, string? alias = null)
Valid only for: SELECT statements.
- public SqlBuilderId select_add_target (string table_name, string? alias = null)
Adds a new target to a SELECT statement
- public SqlBuilderId select_add_target_id (SqlBuilderId table_id, string? alias = null)
Adds a new target to a SELECT statement.
- public void select_group_by (SqlBuilderId expr_id)
Valid only for: SELECT statements
- public SqlBuilderId select_join_targets (SqlBuilderId left_target_id, SqlBuilderId right_target_id, SqlSelectJoinType join_type, SqlBuilderId join_expr)
Joins two targets in a SELECT statement, using the
join_type
type of join. - public void select_order_by (SqlBuilderId expr_id, bool asc, string? collation_name = null)
Adds a new ORDER BY expression to a SELECT statement.
- public void select_set_distinct (bool distinct, SqlBuilderId expr_id)
Defines (if
distinct
is true) or removes (ifdistinct
is false) a DISTINCT clause for a SELECT statement. - public void select_set_having (SqlBuilderId cond_id)
Valid only for: SELECT statements
- public void select_set_limit (SqlBuilderId limit_count_expr_id, SqlBuilderId limit_offset_expr_id)
If
limit_count_expr_id
is not 0 , defines the maximum number of rows in the DataModel resulting from the execution of the built statement. - public void set_table (string table_name)
Valid only for: INSERT, UPDATE, DELETE statements
- public void set_where (SqlBuilderId cond_id)
Valid only for: UPDATE, DELETE, SELECT statements
Inherited Members:
All known members inherited from class GLib.Object