MySqlDelete

Execute a MySQL DELETE statement.

Added in version 1.0.0.

  • Friendly name: MySQL Delete

  • Step class: base_steps_syncpack.steps.MySqlDelete.MySqlDelete

  • Step version: 1.0.0

  • Required parameters: database, host, port, username, password

Parameters

Name

Type

Required

Default

Description

table

string

no

–

The database table name. Example: Users

database

string

yes

–

The database name. Example: database1

host

string

yes

–

The host of the database. Example: host1

port

number

yes

7706

The port of the database. Example: 8008

username

string

yes

–

The database username. Example: db_user_name

password

string

yes

–

The database password. Example: db_user_password

delete_query

string (long)

no

–

A full DELETE statement. Overrides the ‘data’ parameter. Example: DELETE FROM table_name WHERE id=1;

where

string (long)

no

–

where condition Example: id like '%test';

Every step also accepts the platform parameters common to all steps – see Platform parameters.

Dependencies

  • Inherits from: MySqlDelete -> BaseStep -> Serializable

  • SyncPack modules: base_steps_syncpack.util.mysql_utils

  • External packages: ipaascommon, ipaascore

Behaviour

Runs a DELETE and commits, via util.mysql_utils (get_connection / execute_query). Unlike the other MySQL steps, its connection parameters are imported StepParameter singletons from mysql_utils rather than declared inline — the effect is the same, but a change there changes this step.

The statement is resolved as:

  • delete_query, used verbatim, and must start with delete;

  • otherwise DELETE FROM {database}.{table}, with WHERE {where} appended when where is set;

  • otherwise MissingRequiredStepParameter is raised.

Outputs

None. The step does not call save_data_for_next_step.

Notes

Warning

where defaults to an empty string, and an empty where builds DELETE FROM db.table with no predicate — which deletes every row in the table. There is no confirmation and no dry run. Always set where, or put the full predicate in delete_query.

  • port defaults to 7706, the SL1 MySQL port.

  • delete_query overrides the built statement, so table/where are ignored when it is set.