gda.sql_builder
Module for [SqlBuilder] class
Types 4
Methods
SqlBuilderGidBuilder builder() static nothrowGet builder for [gda.sql_builder.SqlBuilder] Returns: New builder objectgda.types.SqlBuilderId addCase(gda.types.SqlBuilderId testExpr, gda.types.SqlBuilderId elseExpr, gda.types.SqlBuilderId[] whenArray, gda.types.SqlBuilderId[] thenArray) nothrowCreates a new CASE ... WHEN ... THEN ... ELSE ... END expression. The WHEN expression and the THEN expression IDs are taken from the when_array and then_array at the same index, for each index infe...gda.types.SqlBuilderId addCond(gda.types.SqlOperatorType op, gda.types.SqlBuilderId op1, gda.types.SqlBuilderId op2, gda.types.SqlBuilderId op3) nothrowBuilds a new expression which represents a condition (or operation).gda.types.SqlBuilderId addCondV(gda.types.SqlOperatorType op, gda.types.SqlBuilderId[] opIds) nothrowBuilds a new expression which represents a condition (or operation).gda.types.SqlBuilderId addExprValue(gda.data_handler.DataHandler dh = null, gobject.value.Value value = null) nothrowDefines an expression in builder which may be reused to build other parts of a statement.gda.types.SqlBuilderId addFieldId(string fieldName, string tableName = null) nothrowDefines 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.sql_builder.SqlBuilder.addCond] or [gda.sql_build...void addFieldValueAsGvalue(string fieldName, gobject.value.Value value = null) nothrowValid only for: INSERT, UPDATE statements.void addFieldValueId(gda.types.SqlBuilderId fieldId, gda.types.SqlBuilderId valueId) nothrowValid 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 by value_id.</para>...gda.types.SqlBuilderId addFunction(string funcName, gda.types.SqlBuilderId[] args) nothrowBuilds a new expression which represents a function applied to some argumentsgda.types.SqlBuilderId addId(string str) nothrowDefines 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.sql_builder.SqlBuilder.addCond] or [gda.sql...gda.types.SqlBuilderId addParam(string paramName, gobject.types.GType type, bool nullok) nothrowDefines a parameter in builder which may be reused to build other parts of a statement.void compoundAddSubSelectFromBuilder(gda.sql_builder.SqlBuilder subselect) nothrowAdd a sub select to a COMPOUND statementvoid compoundSetType(gda.types.SqlStatementCompoundType compoundType) nothrowChanges the type of compound which builder is making, for a COMPOUND statementgda.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) nothrowImports the an expression located in query into builder.void joinAddField(gda.types.SqlBuilderId joinId, string fieldName) nothrowAlter 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) nothrowValid only for: SELECT statements.gda.types.SqlBuilderId selectAddTarget(string tableName, string alias_ = null) nothrowAdds a new target to a SELECT statementgda.types.SqlBuilderId selectAddTargetId(gda.types.SqlBuilderId tableId, string alias_ = null) nothrowAdds 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 selectOrderBy(gda.types.SqlBuilderId exprId, bool asc, string collationName = null) nothrowAdds a new ORDER BY expression to a SELECT statement.void selectSetDistinct(bool distinct, gda.types.SqlBuilderId exprId) nothrowDefines (if distinct is true) or removes (if distinct is false) a DISTINCT clause for a SELECT statement.void selectSetLimit(gda.types.SqlBuilderId limitCountExprId, gda.types.SqlBuilderId limitOffsetExprId) nothrowIf limit_count_expr_id 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 ...void setWhere(gda.types.SqlBuilderId condId) nothrowValid only for: UPDATE, DELETE, SELECT statementsConstructors
this(gda.types.SqlStatementType stmtType)Create a new #GdaSqlBuilder object to build #GdaStatement or #GdaSqlStatement objects of type stmt_typeFluent builder implementation template for gda.sql_builder.SqlBuilder
Fluent builder for gda.sql_builder.SqlBuilder
Methods
classSqlBuilderException : ErrorWrap