MySqlDescribe

Execute a MySQL DESC statement.

Added in version 1.0.0.

  • Friendly name: MySQL Describe

  • Step class: base_steps_syncpack.steps.MySqlDescribe.MySqlDescribe

  • Step version: 1.1.1

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

Parameters

Name

Type

Required

Default

Description

table

string

yes

–

The database Table Example: Users

database

string

yes

–

The database Example: database1

host

string

yes

–

The host of the database Example: host1

username

string

yes

–

The db username Example: ${db_user_name}

password

string

yes

–

The db password Example: ${db_password}

port

number

yes

7706

The port number to use when establishing a connection to the remote sql server.

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

Dependencies

  • Inherits from: MySqlDescribe -> BaseStep -> Serializable

  • SyncPack modules: base_steps_syncpack.util.mysql_utils

  • External packages: ipaascommon, ipaascore

Behaviour

Connects through util.mysql_utils.util_connect_mysql and runs DESC {table}. Useful for discovering a schema at runtime rather than hardcoding column names into a workflow.

Outputs

A list of row dicts describing the columns (DictCursor), or []:

[
  {"Field": "id", "Type": "int(11)", "Null": "NO", "Key": "PRI"},
  {"Field": "device", "Type": "varchar(64)", "Null": "YES", "Key": ""}
]

Notes

  • table is required here, unlike MySqlSelect where it is optional.

  • port defaults to 7706, the SL1 MySQL port.

  • The column keys are MySQL’s own (Field, Type, Null, Key, Default, Extra) and are capitalised. The MS-SQL equivalent, MicrosoftSqlDescribe, returns tuples instead, so the two are not interchangeable downstream.