Skip to content

Latest commit

 

History

History
372 lines (276 loc) · 8.19 KB

sddm-plus.md

File metadata and controls

372 lines (276 loc) · 8.19 KB

sddm-plus.groovy methods

Table methods

Column methods

Writes to the Data Modeler log window.

Syntax

log(String message)

Parameters

Name Description
message The message that is displayed in the log window

Displays a message in a dialog box.

Syntax

show (String message)

Parameters

Name Description
message The message that is displayed in the dialog box

Top

Displays a message in a dialog box and returns the string that is input.

Syntax

ask (String question)

Parameters

Name Description
question The message that is displayed in the dialog box
return A String object containing the user input

Top

Returns a list of the table objects found in the current relational model.

Syntax

getTables()

Parameters

Name Description
return List of Table objects

Top

Returns the table with the given name (case insensitive) found in the current relational model.

Syntax

getTableWhereNameEquals(String matcher)

Parameters

Name Description
matcher A String that is the name of the table
return A Table object

Top

Returns a List of Table objects from the current relational model that match the given matcher (case insensitive).

This method compares the table names with the matcher and returns those table objects that match.

The matcher is case insensitive and recognizes wildcards of '*' and '%' at the beginning or end and can take several forms.

  • A simple string: 'test'
  • A string contining a list of comma-seperated values: 'abc, 123, *test'
  • A Groovy List of strings: ['abc', '%123', 'test*']

Syntax

getTablesWhereNameLike(matcher)

Parameters

Name Description
matcher A String or List
return A List of Table objects

Top

Returns a List of Table objects from the current relational model that do not match the given matcher (case insensitive).

This method compares the table names with the matcher and returns those table objects that match.

The matcher is case insensitive and recognizes wildcards of '*' and '%' at the beginning or end and can take several forms.

  • A simple string: 'test'
  • A string contining a list of comma-seperated values: 'abc, 123, *test'
  • A Groovy List of strings: ['abc', '%123', 'test*']

Syntax

getTablesWhereNameNotLike(matcher)

Parameters

Name Description
matcher A String or List
return A List of Table objects

Top

Returns all columns of a table.

Syntax

getColumns()

Example

getTables().each {table ->
  log ("Table: ${table.name}")
  table.getColumns().each {col ->
    log ("  ${col.name}")
  }
}
// or, using Groovy's "getter as a property" goodness
tables.each {table ->
  log ("Table: ${table.name}")
  table.columns.each {col ->
    log ("  ${col.name}")
  }
}

Parameters

Name Description
return List of Column objects

Top

Returns the column of a table with the given name (case insensitive)

Syntax

getColumnWhereNameEquals(String matcher)

Parameters

Name Description
matcher A String that is the name of the column
return A Column object.

Top

Returns a List of Column objects that match the given matcher (case insensitive).

This method compares the column names with the matcher and returns those column objects that match.

The matcher is case insensitive and recognizes wildcards of '*' and '%' at the beginning or end and can take several forms.

  • A simple string: 'test'
  • A string contining a list of comma-seperated values: 'abc, 123, *test'
  • A Groovy List of strings: ['abc', '%123', 'test*']

Syntax

Table.getColumnsWhereNameLike(matcher)

Parameters

Name Description
matcher A String or List
return A List of Column objects

Top

Returns a List of Column objects that do not match the given matcher (case insensitive).

This method compares the column names with the matcher and returns those column objects that do not match.

The matcher is case insensitive and recognizes wildcards of '*' and '%' at the beginning or end and can take several forms.

  • A simple string: 'test'
  • A string contining a list of comma-seperated values: 'abc, 123, *test'
  • A Groovy List of strings: ['abc', '%123', 'test*']

Syntax

Table.getColumnsWhereNameNotLike(matcher)

Parameters

Name Description
matcher A String or List
return A List of Column objects

Top

Creates a column on the table using the provided information.

This method adds a column to the table. Currently Numeric, Varchar and Date data types are supported.

Parameters

Name Description
colName The name of the new column
datatype The data type of the new column
precisionOrSize The precision of a numeric column, or the size of a varchar. Use '' for date.
scaleOrType The scale of a numeric column, or the type, byte or char, for a varchar. Use '' for date.

Syntax

Table.addColumn(String colName, String datatype, String precisionOrSize, String scaleOrType)

Top

Removes a column from the table based on the name.

This method drops a column from the table.

Parameters

Name Description
colName The name of the column to be dropped

Syntax

Table.dropColumn(String colName)

Top

Outputs a listing of all properties of the table to the system log.

This method outputs all available properties of the given table to the system log.

This method is designed to allow for easier exploration of available properties, and is meant to be used along side of the index.html documentation file.

Some properties can not be displayed due to insufficient documentation of the getter methods, others may display null values for the same reason.

Syntax

Table.logProperties()

Top

Outputs a listing of all properties of the column to the system log.

This method outputs all available properties of the given column to the system log.

This method is designed to allow for easier exploration of available properties, and is meant to be used along side of the index.html documentation file.

Some properties can not be displayed due to insufficient documentation of the getter methods, others may display null values for the same reason.

Syntax

Column.logProperties()

Top