MySqlInsert
Execute a MySQL INSERT statement.
Added in version 1.0.0.
Friendly name:
MySQL InsertStep class:
base_steps_syncpack.steps.MySqlInsert.MySqlInsertStep version:
1.1.1Required parameters:
database,host,username,password,port
Parameters
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
no |
– |
The database table name. Example: |
|
string |
yes |
– |
The database name. Example: |
|
string |
yes |
– |
The host of the database. Example: |
|
string |
yes |
– |
The database username. Example: |
|
string |
yes |
– |
The database password. Example: |
|
string (long) |
no |
– |
A full INSERT statement. Overrides the ‘data’ parameter. Example: |
|
json |
no |
– |
The data to insert into the database table. Example: |
|
number |
yes |
|
The port of the database. Example: |
Every step also accepts the platform parameters common to all steps – see Platform parameters.
Dependencies
Inherits from:
MySqlInsert->BaseStep->SerializableSyncPack modules:
base_steps_syncpack.util.mysql_utilsExternal packages:
ipaascommon,ipaascore
Behaviour
Connects through util.mysql_utils.util_connect_mysql (pymysql, DictCursor)
and runs an INSERT, then commits.
The statement comes from one of two places:
insert_query— used verbatim, and must start withinsert;otherwise built from
data(column to value) plustable.
One of insert_query or the data + table pair is required.
Outputs
None. The step does not call save_data_for_next_step. Downstream steps see
whatever the previous step produced.
Example
{
"host": "db.example.com",
"port": 7706,
"database": "master_events",
"username": "svc_pf",
"password": "${config.db_password}",
"table": "sync_log",
"data": {"device_id": 4021, "synced_at": "2026-08-25T12:00:00Z"}
}
Notes
portis marked required with a default of7706— the SL1 MySQL port, not MySQL’s usual3306.insert_queryoverridesdataentirely; setting both silently ignoresdata.The leading-
insertcheck is a literal string test, so a statement beginning with a comment or whitespace-then-keyword will be rejected.