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
validity_meta_struct: Gda.MetaStruct
name: string

Methods

  • check_clean(): void
  • check_structure(): 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

  • delete_take_table_name(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
  • insert_take_1_values_list(list: Gda.SqlExpr[]): 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

  • insert_take_extra_values_list(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

  • insert_take_on_conflict(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

  • insert_take_table_name(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

  • select_take_distinct(distinct: boolean, distinct_expr: 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

    • distinct_expr: 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

  • select_take_group_by(group_by: Gda.SqlExpr[]): 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

    • group_by: 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
  • trans_take_mode(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

  • trans_take_name(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

  • unknown_take_expressions(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

  • update_take_on_conflict(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

  • update_take_set_value(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

  • update_take_table_name(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

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