gda.sql_builder

Module for [SqlBuilder] class

Types 4

Methods
GType _gType() @property
SqlBuilder self()Returns `this`, for use in `with` statements.
SqlBuilderGidBuilder builder()Get builder for [gda.sql_builder.SqlBuilder] Returns: New builder object
gda.types.SqlBuilderId addCase(gda.types.SqlBuilderId testExpr, gda.types.SqlBuilderId elseExpr, gda.types.SqlBuilderId[] whenArray, gda.types.SqlBuilderId[] thenArray)Creates a new CASE ... WHEN ... THEN ... ELSE ... END expression. The WHEN expression and the THEN expression IDs are taken from the whenarray and thenarray at the same index, for each index inferi...
gda.types.SqlBuilderId addCond(gda.types.SqlOperatorType op, gda.types.SqlBuilderId op1, gda.types.SqlBuilderId op2, gda.types.SqlBuilderId op3)Builds a new expression which represents a condition (or operation).
gda.types.SqlBuilderId addCondV(gda.types.SqlOperatorType op, gda.types.SqlBuilderId[] opIds)Builds a new expression which represents a condition (or operation).
gda.types.SqlBuilderId addExprValue(gda.data_handler.DataHandler dh = null, gobject.value.Value value = null)Defines an expression in builder which may be reused to build other parts of a statement.
gda.types.SqlBuilderId addFieldId(string fieldName, string tableName = null)Defines an expression representing a field in builder, which may be reused to build other parts of a statement, for instance as a parameter to [gda.sqlbuilder.SqlBuilder.addCond] or [gda.sqlbuilder...
void addFieldValueAsGvalue(string fieldName, gobject.value.Value value = null)Valid only for: INSERT, UPDATE statements.
void addFieldValueId(gda.types.SqlBuilderId fieldId, gda.types.SqlBuilderId valueId)Valid only for: INSERT, UPDATE, SELECT statements <itemizedlist> <listitem><para>For UPDATE: specifies that the field represented by fieldid will be set to the value identified by valueid.</para></...
gda.types.SqlBuilderId addFunction(string funcName, gda.types.SqlBuilderId[] args)Builds a new expression which represents a function applied to some arguments
gda.types.SqlBuilderId addId(string str)Defines an expression representing an identifier in builder, which may be reused to build other parts of a statement, for instance as a parameter to [gda.sqlbuilder.SqlBuilder.addCond] or [gda.sqlb...
gda.types.SqlBuilderId addParam(string paramName, gobject.types.GType type, bool nullok)Defines a parameter in builder which may be reused to build other parts of a statement.
void compoundAddSubSelectFromBuilder(gda.sql_builder.SqlBuilder subselect)Add a sub select to a COMPOUND statement
void compoundSetType(gda.types.SqlStatementCompoundType compoundType)Changes the type of compound which builder is making, for a COMPOUND statement
gda.statement.Statement getStatement()Creates a new #GdaStatement statement from builder's contents. Returns: a new #GdaStatement object, or null if an error occurred Throws: [SqlBuilderException]
gda.types.SqlBuilderId importExpressionFromBuilder(gda.sql_builder.SqlBuilder query, gda.types.SqlBuilderId exprId)Imports the an expression located in query into builder.
void joinAddField(gda.types.SqlBuilderId joinId, string fieldName)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.
gda.types.SqlBuilderId selectAddField(string fieldName, string tableName = null, string alias_ = null)Valid only for: SELECT statements.
gda.types.SqlBuilderId selectAddTarget(string tableName, string alias_ = null)Adds a new target to a SELECT statement
gda.types.SqlBuilderId selectAddTargetId(gda.types.SqlBuilderId tableId, string alias_ = null)Adds a new target to a SELECT statement. If there already exists a target representing the same table and the same alias (or with the same absence of alias) then the same target ID is returned inst...
void selectGroupBy(gda.types.SqlBuilderId exprId)Valid only for: SELECT statements
void selectOrderBy(gda.types.SqlBuilderId exprId, bool asc, string collationName = null)Adds a new ORDER BY expression to a SELECT statement.
void selectSetDistinct(bool distinct, gda.types.SqlBuilderId exprId)Defines (if distinct is true) or removes (if distinct is false) a DISTINCT clause for a SELECT statement.
void selectSetHaving(gda.types.SqlBuilderId condId)Valid only for: SELECT statements
void selectSetLimit(gda.types.SqlBuilderId limitCountExprId, gda.types.SqlBuilderId limitOffsetExprId)If limitcountexprid is not `0`, defines the maximum number of rows in the #GdaDataModel resulting from the execution of the built statement. In this case, the offset from which the rows must be col...
void setTable(string tableName)Valid only for: INSERT, UPDATE, DELETE statements
void setWhere(gda.types.SqlBuilderId condId)Valid only for: UPDATE, DELETE, SELECT statements
Constructors
this(void * ptr, Flag!"Take" take)
this(gda.types.SqlStatementType stmtType)Create a new #GdaSqlBuilder object to build #GdaStatement or #GdaSqlStatement objects of type stmt_type

Fluent builder for [gda.sql_builder.SqlBuilder]

Methods
Constructors
this(GError * err)
this(Code code, string msg)