Skip to content
johmue edited this page May 25, 2012 · 1 revision

Parameters describe database entities e.g. a column. Below you can find the Workbench XML structure for a last_update column of mysql type timestamp to understand what parameters are for.

...
<value type="object" struct-name="db.mysql.Column" id="{8C1CFD3F-A65F-4CC3-9791-150781C7C4C1}" struct-checksum="0x783b5183">
    <value type="int" key="autoIncrement">0</value>
    <value type="string" key="characterSetName"></value>
    <value _ptr_="0A345320" type="list" content-type="object" content-struct-name="db.CheckConstraint" key="checks"/>
    <value type="string" key="collationName"></value>
    <value type="string" key="datatypeExplicitParams"></value>
    <value type="string" key="defaultValue">CURRENT_TIMESTAMP</value>
    <value type="int" key="defaultValueIsNull">0</value>
    <value _ptr_="0A345378" type="list" content-type="string" key="flags">
        <value type="string">UNSIGNED</value>
    </value>
    <value type="int" key="isNotNull">1</value>
    <value type="int" key="length">-1</value>
    <value type="int" key="precision">-1</value>
    <value type="int" key="scale">-1</value>
    <link type="object" struct-name="db.SimpleDatatype" key="simpleType">com.mysql.rdbms.mysql.datatype.timestamp</link>
    <value type="string" key="comment"></value>
    <value type="string" key="name">last_update</value>
    <value type="string" key="oldName">last_update</value>
    <link type="object" struct-name="GrtObject" key="owner">{E1526C7B-1737-41A7-B4C2-8AEA23E4C62E}</link>
</value>
...

Accessing parameters in PHP

All <value>-Tags of type="string" or type="int" (<link>s and type="list" will not work or be empty) can be accessed within a PHP class (see below).

<?php
namespace MwbExporter\Formatter\FrameworkXY\Model;

use MwbExporter\Model\Column as BaseColumn;

class Column extends BaseColumn
{
    ...
    public function isAutoIncrement()
    {
        return $this->parameters->get('autoIncrement') ? true : false;
    }
    ...
}

List of available parameters

Please see the raw Workbench XML to check whether a (missing) parameter exists or not. The list below might be incomplete. If you find a missing parameter please open an issue.

Catalog

  • (none)

Column

  • autoIncrement
  • characterSetName
  • checks
  • collationName
  • datatypeExplicitParams
  • defaultValue
  • defaultValueIsNull
  • flags
  • isNotNull
  • length
  • precision
  • scale
  • comment
  • name
  • oldName

Columns

  • (none)

Document

  • (none)

ForeignKey

  • columns
  • deferability
  • deleteRule
  • mandatory
  • many
  • modelOnly
  • referencedColumns
  • referencedMandatory
  • updateRule
  • comment
  • name
  • oldName

ForeignKeys

  • (none)

Index

  • columns
  • indexKind
  • keyBlockSize
  • withParser
  • comment
  • deferability
  • indexType
  • isPrimary
  • name
  • unique
  • oldName

Indices

  • (none)

PhysicalModel

  • (none)

Schema

  • (none)

Schemas

  • (none)

Table

  • avgRowLength
  • checksum
  • columns
  • connectionString
  • defaultCharacterSetName
  • defaultCollationName
  • delayKeyWrite
  • foreignKeys
  • indices
  • maxRows
  • mergeInsert
  • mergeUnion
  • minRows
  • nextAutoInc
  • packKeys
  • partitionCount
  • partitionDefinitions
  • partitionExpression
  • partitionType
  • password
  • raidChunkSize
  • raidChunks
  • raidType
  • rowFormat
  • subpartitionCount
  • subpartitionExpression
  • subpartitionType
  • tableDataDir
  • tableEngine
  • tableIndexDir
  • triggers
  • isStub
  • isSystem
  • isTemporary
  • temporaryScope
  • commentedOut
  • createDate
  • customData
  • lastChangeDate
  • modelOnly
  • name
  • temp_sql
  • comment
  • oldName

Tables

  • (none)

View

  • (none)

Views

  • (none)