mysqlx.InsertStatementΒΆ

class mysqlx.InsertStatement(table: DatabaseTargetType, *fields: Any)ΒΆ

Bases: WriteStatement

A statement for insert operations on Table.

Parameters:
  • table (mysqlx.Table) – The Table object.

  • *fields – The fields to be inserted.

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() β†’ ResultΒΆ

Execute the statement.

Returns:

Result object.

Return type:

mysqlx.Result

get_values() β†’ List[int | str | DbDoc | Dict[str, Any] | List[str | int | float | ExprParser | Dict[str, Any] | None]]ΒΆ

Returns the list of values.

Returns:

The list of values.

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: SchemaTypeΒΆ

The Schema object.

Type:

mysqlx.Schema

property stmt_id: intΒΆ

Returns this statement ID.

Returns:

The statement ID.

Return type:

int

property target: DatabaseTargetTypeΒΆ

The database object target.

Type:

object

values(*values: Any) β†’ InsertStatementΒΆ

Set the values to be inserted.

Parameters:

*values – The values of the columns to be inserted.

Returns:

InsertStatement object.

Return type:

mysqlx.InsertStatement