Gjsify LogoGjsify Logo

This structure is the top level structure encapsulating several type of statements.

record

Hierarchy

  • SqlStatement

Index

Constructors

Properties

contents: object

contents, cast it depending on stmt_type (for example to a #GdaSqlStatementSelect).

field
sql: string

type of statement

field
validityMetaStruct: Gda.MetaStruct
name: string

Methods

  • checkClean(): void
  • Cleans any data set by a previous call to gda_sql_statement_check_validity().

    Returns void

  • checkStructure(): boolean
  • Checks for any error in stmt's structure to make sure the statement is valid (for example a SELECT statement must at least return a column, a DELETE statement must specify which table is targeted).

    Returns boolean

  • If cnc is not %NULL, then checks that all the database objects referenced in the statement actually exist in the connection's database (for example the table being updated in a UPDATE statement must exist in the connection's database for the check to succeed). This method fills the stmt->validity_meta_struct attribute.

    If cnc is %NULL, then remove any information from a previous call to this method stored in stmt. In this case, the stmt->validity_meta_struct attribute is cleared.

    Also note that some parts of stmt may be modified: for example leading and trailing spaces in aliases or objects names will be removed.

    Parameters

    Returns boolean

  • If mstruct is not %NULL, then checks that all the database objects referenced in the statement i actually referenced in mstruct (for example the table being updated in a UPDATE statement must exist in the connection's database for the check to succeed). This method sets the stmt->validity_meta_struct attribute to mstruct.

    If mstruct is %NULL, then remove any information from a previous call to this method stored in stmt. In this case, the stmt->validity_meta_struct attribute is cleared.

    Also note that some parts of stmt may be modified: for example leading and trailing spaces in aliases or objects names will be removed.

    Parameters

    Returns boolean

  • Adds the s sub-statement to the stmt compound statement. s's reference is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • Sets the WHERE condition of stmt. cond's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • cond: Gda.SqlExpr

      the WHERE condition of the DELETE statement, as a #GdaSqlExpr

    Returns void

  • deleteTakeTableName(value: any): void
  • Sets the name of the table to delete from in stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      a table name as a G_TYPE_STRING #GValue

    Returns void

  • free(): void
  • Sets a list of values to be inserted by stmt. list's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • list: Gda.SqlExpr[]

      a list of #GdaSqlExpr pointers

    Returns void

  • insertTakeExtraValuesList(list: Gda.SqlExpr[]): void
  • Sets a list of list of values to be inserted by stmt. list's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • list: Gda.SqlExpr[]

      a list of #GSList of #GdaSqlExpr pointers

    Returns void

  • Sets the list of fields for which values will be specified in stmt. list's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • insertTakeOnConflict(value: any): void
  • Sets the name of the resolution conflict algorithm used by stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      name of the resolution conflict algorithm, as a G_TYPE_STRING #GValue

    Returns void

  • Specifies a SELECT statement, the values inserted will be the result set of select. select's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • insertTakeTableName(value: any): void
  • Sets the name of the table to insert into in stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      name of the table to insert into, as a G_TYPE_STRING #GValue

    Returns void

  • "Normalizes" (in place) some parts of stmt, which means stmt may be modified. At the moment any "*" field in a SELECT statement will be replaced by one #GdaSqlSelectField structure for each field in the referenced table.

    Parameters

    Returns boolean

  • selectTakeDistinct(distinct: boolean, distinctExpr: Gda.SqlExpr): void
  • Sets the DISTINCT clause of stmt.

    distinct_expr's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • distinct: boolean

      a TRUE/FALSE value

    • distinctExpr: Gda.SqlExpr

      a #GdaSqlExpr pointer representing what the DISTINCT is on, or %NULL

    Returns void

  • Sets list of expressions selected by stmt

    expr_list's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • Sets the FROM clause of stmt

    from's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • Sets the GROUP BY clause of stmt

    group_by's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • groupBy: Gda.SqlExpr[]

      a list of #GdaSqlExpr pointer

    Returns void

  • Sets the HAVING clause of stmt

    expr's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • Sets the LIMIT clause of stmt

    count and offset's responsibility are transferred to stmt (which means stmt is then responsible for freeing them when no longer needed).

    Parameters

    Returns void

  • Sets the ORDER BY clause of stmt

    order_by's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • Sets the WHERE clause of stmt

    expr's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • serialize(): string
  • transTakeMode(value: any): void
  • Sets the model of the transaction

    value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      a G_TYPE_STRING value

    Returns void

  • transTakeName(value: any): void
  • Sets the name of the transaction

    value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      a G_TYPE_STRING value

    Returns void

  • unknownTakeExpressions(expressions: Gda.SqlExpr[]): void
  • Sets stmt's list of expressions

    expressions's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • expressions: Gda.SqlExpr[]

      a list of #GdaSqlExpr pointers

    Returns void

  • Sets the WHERE clause of stmt

    expr's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    Returns void

  • updateTakeOnConflict(value: any): void
  • Sets the name of the resolution conflict algorithm used by stmt. value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      name of the resolution conflict algorithm, as a G_TYPE_STRING #GValue

    Returns void

  • updateTakeSetValue(fname: any, expr: Gda.SqlExpr): void
  • Specifies that the field named fname will be updated with the expression expr.

    fname and expr's responsibility are transferred to stmt (which means stmt is then responsible for freeing them when no longer needed).

    Parameters

    • fname: any

      a field name, as a G_TYPE_STRING #GValue

    • expr: Gda.SqlExpr

      a #GdaSqlExpr pointer

    Returns void

  • updateTakeTableName(value: any): void
  • Sets the name of the table to delete from in stmt.

    value's ownership is transferred to stmt (which means stmt is then responsible for freeing it when no longer needed).

    Parameters

    • value: any

      a table name, as a G_TYPE_STRING #GValue

    Returns void

  • Converts a string to a #GdaSqlStatementType value, see also gda_sql_statement_type_to_string()

    Parameters

    • type: string

      a string representing a #GdaSqlStatementType type

    Returns Gda.SqlStatementType

  • Converts a #GdaSqlStatementType to a string, see also gda_sql_statement_string_to_type()

    Parameters

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method