mysqlx.SqlStatement

class mysqlx.SqlStatement(connection: Connection, sql: str)

Bases: Statement

A statement for SQL execution.

Parameters:
  • connection (mysqlx.connection.Connection) – Connection object.

  • sql (string) – The sql statement to be executed.

bind(*args: Any) SqlStatement

Binds value(s) to a specific placeholder(s).

Parameters:

*args – The value(s) to bind.

Returns:

SqlStatement object.

Return type:

mysqlx.SqlStatement

property changed: bool

True if this statement has changes.

Type:

bool

property deallocate_prepare_execute: bool

True to deallocate + prepare + execute statement.

Type:

bool

property exec_counter: int

The number of times this statement was executed.

Type:

int

execute() SqlResult

Execute the statement.

Returns:

SqlResult object.

Return type:

mysqlx.SqlResult

get_binding_map() Dict[str, Any]

Returns the binding map dictionary.

Returns:

The binding map dictionary.

Return type:

dict

get_bindings() Tuple | List

Returns the bindings list.

Returns:

The bindings list.

Return type:

list

increment_exec_counter() None

Increments the number of times this statement has been executed.

is_doc_based() bool

Check if it is document based.

Returns:

True if it is document based.

Return type:

bool

property prepared: bool

True if this statement has been prepared.

Type:

bool

property repeated: bool

True if this statement was executed more than once.

Type:

bool

reset_exec_counter() None

Resets the number of times this statement has been executed.

property schema: Schema

The Schema object.

Type:

mysqlx.Schema

property sql: str

The SQL text statement.

Type:

string

property stmt_id: int

Returns this statement ID.

Returns:

The statement ID.

Return type:

int

property target: DatabaseObject

The database object target.

Type:

object