Child pages
  • JSColumnObject

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#DATABASE_IDENTITY] Constant used when setting or getting the sequence type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#DATABASE_SEQUENCE] Constant used when setting or getting the sequence type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#DATETIME] Constant used when setting or getting the type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#EXCLUDED_COLUMN] Constant used when setting or getting the flags of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#INTEGER] Constant used when setting or getting the type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#MEDIA] Constant used when setting or getting the type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#NONE] Constant for column information indicating unset values.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#NUMBER] Constant used when setting or getting the type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#PK_COLUMN] Constant used when setting or getting the row identifier type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#ROWID_COLUMN] Constant used when setting or getting the row identifier type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#SERVOY_SEQUENCE] Constant used when setting or getting the sequence type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#TEXT] Constant used when setting or getting the type of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#UUID_COLUMN] Constant used when setting or getting the flags of columns.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#UUID_GENERATOR] Constant used when setting or getting the sequence type of columns.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#allowNull] Get or set the allow\-null flag of a new column.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#rowIdentifierType] Get or set the row identifier type of the column.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#sequenceType] Get or set the sequence type of the column.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#getDataProviderID]\() Get the data provider id for this column (which is the same as name if not explicitly defined otherwise).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getDescription]\() Get the description property of the column.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getForeignType]\() Get the foreign type of the column.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getLength]\() Get the length of the column as reported by the JDBC driver.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getQualifiedName]\() Get the qualified name (including table name) of the column as known by the database.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getQuotedSQLName]\() Returns a quoted version of the column name, if necessary, as defined by the actual database used.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getSQLName]\() Get the name of the column as known by the database.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getScale]\() Get the scale of the column as reported by the JDBC driver.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getTitle]\() Get the title property of the column.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getType]\() Get the JDBC type of the column.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getTypeAsString]\() Get the name JDBC type of the column.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#hasFlag]\(flag) Check a flag of the column.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setDatabaseSequenceName]\() Set the database sequence name of the column, used for columns with sequence type JSColumn.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setFlag]\(flag, set) Set or clear a flag of a new column.{td}{tr}{tbody}{table}\\ {table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=DATABASE_IDENTITY}{tr:id=name}{td}h6.DATABASE_IDENTITY{td}{tr}{tr:id=des}{td}{div:class=sIndent}Constant used when setting or getting the sequence type of columns.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#DATABASE_IDENTITY
Constant used when setting or getting the sequence type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#DATABASE_SEQUENCE
Constant used when setting or getting the sequence type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#DATETIME
Constant used when setting or getting the type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#EXCLUDED_COLUMN
Constant used when setting or getting the flags of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#INTEGER
Constant used when setting or getting the type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#MEDIA
Constant used when setting or getting the type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#NONE
Constant for column information indicating unset values.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#NUMBER
Constant used when setting or getting the type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#PK_COLUMN
Constant used when setting or getting the row identifier type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#ROWID_COLUMN
Constant used when setting or getting the row identifier type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#SERVOY_SEQUENCE
Constant used when setting or getting the sequence type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#TEXT
Constant used when setting or getting the type of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#UUID_COLUMN
Constant used when setting or getting the flags of columns.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#UUID_GENERATOR
Constant used when setting or getting the sequence type of columns.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#allowNull
Get or set the allow-null flag of a new column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#rowIdentifierType
Get or set the row identifier type of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#sequenceType
Get or set the sequence type of the column.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataProviderID()
Get the data provider id for this column (which is the same as name if not explicitly defined otherwise).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDescription()
Get the description property of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getForeignType()
Get the foreign type of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getLength()
Get the length of the column as reported by the JDBC driver.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getQualifiedName()
Get the qualified name (including table name) of the column as known by the database.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getQuotedSQLName()
Returns a quoted version of the column name, if necessary, as defined by the actual database used.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getSQLName()
Get the name of the column as known by the database.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getScale()
Get the scale of the column as reported by the JDBC driver.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getTitle()
Get the title property of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getType()
Get the JDBC type of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getTypeAsString()
Get the name JDBC type of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasFlag(flag)
Check a flag of the column.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setDatabaseSequenceName()
Set the database sequence name of the column, used for columns with sequence type JSColumn.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setFlag(flag, set)
Set or clear a flag of a new column.

HTML Table
idconstant
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Constants Details
Table Body (tbody)
idDATABASE_IDENTITY
Table Row (tr)
idname
Table Cell (td)
DATABASE_IDENTITY
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the sequence type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idDATABASE_SEQUENCE
Table Row (tr)
idname
Table Cell (td)
DATABASE_SEQUENCE
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the sequence type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idDATETIME
Table Row (tr)
idname
Table Cell (td)
DATETIME
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idEXCLUDED_COLUMN
Table Row (tr)
idname
Table Cell (td)
EXCLUDED_COLUMN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the flags of columns.
This flag identifies columns that are skipped in the sql.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
if (column.hasFlag(JSColumn.UUID_COLUMN))
{
	// handle uuid column
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idINTEGER
Table Row (tr)
idname
Table Cell (td)
INTEGER
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idMEDIA
Table Row (tr)
idname
Table Cell (td)
MEDIA
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;

...


}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idNONE
Table Row (tr)
idname
Table Cell (td)
NONE
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for column information indicating unset values.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idNUMBER
Table Row (tr)
idname
Table Cell (td)
NUMBER
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column

...


break;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idPK_COLUMN
Table Row (tr)
idname
Table Cell (td)
PK_COLUMN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the row identifier type of columns.
This value identifies columns that are defined as primary key in the database.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getRowIdentifierType())
{
case JSColumn.NONE:
	// handle normal column
break;

case JSColumn.PK_COLUMN:
	// handle database pk column
break;

case JSColumn.ROWID_COLUMN:
	// handle developer defined pk column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idROWID_COLUMN
Table Row (tr)
idname
Table Cell (td)
ROWID_COLUMN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the row identifier type of columns.
This value identifies columns that are defined as primary key by the developer (but not in the database).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getRowIdentifierType())
{
case JSColumn.NONE:
	// handle normal column
break;

case JSColumn.PK_COLUMN:
	// handle database pk column
break;

case JSColumn.ROWID_COLUMN:
	// handle developer defined pk column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idSERVOY_SEQUENCE
Table Row (tr)
idname
Table Cell (td)
SERVOY_SEQUENCE
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the sequence type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid generated column

...


break;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idTEXT
Table Row (tr)
idname
Table Cell (td)
TEXT
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break;
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idUUID_COLUMN
Table Row (tr)
idname
Table Cell (td)
UUID_COLUMN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the flags of columns.
This flag identifies columns whose values are treated as UUID.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
if (column.hasFlag(JSColumn.UUID_COLUMN))
{
	// handle uuid column
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idUUID_GENERATOR
Table Row (tr)
idname
Table Cell (td)
UUID_GENERATOR
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant used when setting or getting the sequence type of columns.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getSequenceType())
{
case JSColumn.NONE:
	// handle column with no sequence
break;

case JSColumn.UUID_GENERATOR:
	// handle uuid

...

 generated column
break;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idallowNull
Table Row (tr)
idname
Table Cell (td)
allowNull
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get or set the allow-null flag of a new column.
Note that when a column is added to an existing table, allowNull will always be set.
For a primary key column, the allowNull flag will be always off, for other columns the flag is set by default.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var server = plugins.maintenance.getServer("example_data");
if (server)
{
	var table = server.createNewTable("users");
	if (table)
	{
		var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use (JSColumn.TEXT, 36) for UUIDs
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.setFlag(JSColumn.UUID_COLUMN, true)
		pk.sequenceType = JSColumn.UUID_GENERATOR
		var c = table.createNewColumn("name", JSColumn.TEXT, 100);
		c.allowNull = false
		table.createNewColumn("age", JSColumn.INTEGER, 0);
		table.createNewColumn("last_login", JSColumn.DATETIME, 0);
		var result = server.synchronizeWithDB(table);
		if (result) application.output("Table successfully created.");
		else application.output("Table not created.");
	}
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idrowIdentifierType
Table Row (tr)
idname
Table Cell (td)
rowIdentifierType
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get or set the row identifier type of the column.
The sequence type is one of:
- JSColumn.PK_COLUMN
- JSColumn.ROWID_COLUMN
- JSColumn.NONE
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var server = plugins.maintenance.getServer("example_data");
if (server)
{
	// users has uuid pk
	var table = server.createNewTable("users");
	if (table)
	{
		var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use <JSColumn.TEXT, 36> for UUIDs)
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.setFlag(JSColumn.UUID_COLUMN, true)
		pk.sequenceType = JSColumn.UUID_GENERATOR
		table.createNewColumn("name", JSColumn.TEXT, 100);
		var result = server.synchronizeWithDB(table);
		if (result) application.output("Table users successfully created.");
		else application.output("Table users not created.");
	}

	// groups has database sequence pk
	table = server.createNewTable("groups");
	if (table)
	{
		pk = table.createNewColumn("id", JSColumn.INTEGER, 0);
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.sequenceType = JSColumn.DATABASE_SEQUENCE
		pk.setDatabaseSequenceName('mygroupsequence')
		table.createNewColumn("name", JSColumn.TEXT, 100);
		result = server.synchronizeWithDB(table);
		if (result) application.output("Table groups successfully created.");
		else application.output("Table groups not created.");
	}
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsequenceType
Table Row (tr)
idname
Table Cell (td)
sequenceType
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get or set the sequence type of the column.
The sequence type is one of:
- JSColumn.NONE
- JSColumn.SERVOY_SEQUENCE
- JSColumn.DATABASE_SEQUENCE
- JSColumn.DATABASE_IDENTITY
- JSColumn.UUID_GENERATOR;
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var server = plugins.maintenance.getServer("example_data");
if (server)
{
	// users has uuid pk
	var table = server.createNewTable("users");
	if (table)
	{
		var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use <JSColumn.TEXT, 36> for UUIDs)
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.setFlag(JSColumn.UUID_COLUMN, true)
		pk.sequenceType = JSColumn.UUID_GENERATOR
		table.createNewColumn("name", JSColumn.TEXT, 100);
		var result = server.synchronizeWithDB(table);
		if (result) application.output("Table users successfully created.");
		else application.output("Table users not created.");
	}

	// groups has database sequence pk
	table = server.createNewTable("groups");
	if (table)
	{
		pk = table.createNewColumn("id", JSColumn.INTEGER, 0);
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.sequenceType = JSColumn.DATABASE_SEQUENCE
		pk.setDatabaseSequenceName('mygroupsequence')
		table.createNewColumn("name", JSColumn.TEXT, 100);
		result = server.synchronizeWithDB(table);
		if (result) application.output("Table groups successfully created.");
		else application.output("Table groups not created.");
	}
}

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetDataProviderID
Table Row (tr)
idname
Table Cell (td)
getDataProviderID
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataProviderID
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the data provider id for this column (which is the same as name if not explicitly defined otherwise).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String dataprovider id.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
var dataProviderId = column.getDataProviderID()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDescription}{tr:id=name}{td}h6.getDescription{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getDescription{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the description property of the column.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String column description.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDescription
Table Row (tr)
idname
Table Cell (td)
getDescription
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDescription
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the description property of the column.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String column description.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customername')
var desc = column.getDescription()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getForeignType}{tr:id=name}{td}h6.getForeignType{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getForeignType{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the foreign type of the column. The foreign type can be defined design time as a foreign key reference to another table.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String foreign type.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetForeignType
Table Row (tr)
idname
Table Cell (td)
getForeignType
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getForeignType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the foreign type of the column.
The foreign type can be defined design time as a foreign key reference to another table.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String foreign type.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
var foreignType = column.getForeignType()
if (foreignType != null)
{
	var fkTable = databaseManager.getTable('example_data', foreignType)
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getLength}{tr:id=name}{td}h6.getLength{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getLength{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the length of the column as reported by the JDBC driver.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number] -- int column length.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetLength
Table Row (tr)
idname
Table Cell (td)
getLength
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getLength
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the length of the column as reported by the JDBC driver.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number – int column length.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customername')
if (column.getLength() < 10)
{
	 // handle short
column } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getQualifiedName}{tr:id=name}{td}h6.getQualifiedName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getQualifiedName{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the qualified name (including table name) of the column as known by the database. The name is quoted, if necessary, as defined by the actual database used.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String qualified column name.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
 column
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetQualifiedName
Table Row (tr)
idname
Table Cell (td)
getQualifiedName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getQualifiedName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the qualified name (including table name) of the column as known by the database.
The name is quoted, if necessary, as defined by the actual database used.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String qualified column name.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
var qualifiedSqlName = column.getQualifiedName()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getQuotedSQLName}{tr:id=name}{td}h6.getQuotedSQLName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getQuotedSQLName{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns a quoted version of the column name, if necessary, as defined by the actual database used.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- column name, quoted if needed.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetQuotedSQLName
Table Row (tr)
idname
Table Cell (td)
getQuotedSQLName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getQuotedSQLName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a quoted version of the column name, if necessary, as defined by the actual database used.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – column name, quoted if needed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

//use with the raw SQL plugin:
//if the table name contains characters that are illegal in sql, the table name will be quoted
var jsTable = databaseManager.getTable('udm', 'campaigns')
var quotedTableName = jsTable.getQuotedSQLName()
var jsColumn = jsTable.getColumn('active')
var quotedColumnName = jsColumn.getQuotedSQLName()
plugins.rawSQL.executeSQL('udm',  quotedTableName,  'select * from ' + quotedTableName + ' where ' + quotedColumnName + ' = ?', [1])
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getSQLName}{tr:id=name}{td}h6.getSQLName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getSQLName{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the name of the column as known by the database.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String sql name{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetSQLName
Table Row (tr)
idname
Table Cell (td)
getSQLName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getSQLName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the name of the column as known by the database.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String sql name
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
var sqlName = column.getSQLName()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getScale}{tr:id=name}{td}h6.getScale{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getScale{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the scale of the column as reported by the JDBC driver.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number] -- int column scale.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetScale
Table Row (tr)
idname
Table Cell (td)
getScale
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getScale
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the scale of the column as reported by the JDBC driver.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number – int column scale.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customername')
var scale = column.getScale()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTitle}{tr:id=name}{td}h6.getTitle{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getTitle{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the title property of the column.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String column title.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetTitle
Table Row (tr)
idname
Table Cell (td)
getTitle
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getTitle
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the title property of the column.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String column title.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customername')
var title = column.getTitle()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getType}{tr:id=name}{td}h6.getType{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getType{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the JDBC type of the column. The type reported by the JDBC driver will be mapped to one of: \- JSColumn.DATETIME \- JSColumn.TEXT \- JSColumn.NUMBER \- JSColumn.INTEGER \- JSColumn.MEDIA{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number] -- int sql type.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetType
Table Row (tr)
idname
Table Cell (td)
getType
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the JDBC type of the column.
The type reported by the JDBC driver will be mapped to one of:
- JSColumn.DATETIME
- JSColumn.TEXT
- JSColumn.NUMBER
- JSColumn.INTEGER
- JSColumn.MEDIA
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number – int sql type.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
switch (column.getType())
{
case JSColumn.TEXT:
	// handle text column
break;

case JSColumn.NUMBER:
case JSColumn.INTEGER:
	// handle numerical column
break; } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTypeAsString}{tr:id=name}{td}h6.getTypeAsString{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getTypeAsString{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the name JDBC type of the column. The same mapping as defined in JSColumn.getType() is applied.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- String sql name.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

break;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetTypeAsString
Table Row (tr)
idname
Table Cell (td)
getTypeAsString
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getTypeAsString
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the name JDBC type of the column.
The same mapping as defined in JSColumn.getType() is applied.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – String sql name.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
var typeName = column.getTypeAsString()
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=hasFlag-Number}{tr:id=name}{td}h6.hasFlag{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}hasFlag{span}{span}\(flag){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Check a flag of the column. The flags are a bit pattern consisting of 1 or more of the following bits: \- JSColumn.UUID\_COLUMN \- JSColumn.EXCLUDED\_COLUMN{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} flag {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- boolean whether flag is set.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idhasFlag-Number
Table Row (tr)
idname
Table Cell (td)
hasFlag
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasFlag
Span
(flag)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Check a flag of the column.
The flags are a bit pattern consisting of 1 or more of the following bits:
- JSColumn.UUID_COLUMN
- JSColumn.EXCLUDED_COLUMN
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} flag
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean – boolean whether flag is set.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var table = databaseManager.getTable('db:/example_data/orders')
var column = table.getColumn('customerid')
if (column.hasFlag(JSColumn.UUID_COLUMN))
{
	// handle uuid column
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setDatabaseSequenceName}{tr:id=name}{td}h6.setDatabaseSequenceName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}setDatabaseSequenceName{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set the database sequence name of the column, used for columns with sequence type JSColumn.DATABASE\_SEQUENCE.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetDatabaseSequenceName
Table Row (tr)
idname
Table Cell (td)
setDatabaseSequenceName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setDatabaseSequenceName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the database sequence name of the column, used for columns with sequence type JSColumn.DATABASE_SEQUENCE.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var server = plugins.maintenance.getServer("example_data");
if (server)
{
	// users has uuid pk
	var table = server.createNewTable("users");
	if (table)
	{
		var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use <JSColumn.TEXT, 36> for UUIDs)
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.setFlag(JSColumn.UUID_COLUMN, true)
		pk.sequenceType = JSColumn.UUID_GENERATOR
		table.createNewColumn("name", JSColumn.TEXT, 100);
		var result = server.synchronizeWithDB(table);
		if (result) application.output("Table users successfully created.");
		else application.output("Table users not created.");
	}

	// groups has database sequence pk
	table = server.createNewTable("groups");
	if (table)
	{
		pk = table.createNewColumn("id", JSColumn.INTEGER, 0);
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.sequenceType = JSColumn.DATABASE_SEQUENCE
		pk.setDatabaseSequenceName('mygroupsequence')
		table.createNewColumn("name", JSColumn.TEXT, 100);
		result = server.synchronizeWithDB(table);
		if (result) application.output("Table groups successfully created.");
		else application.output("Table groups not created.");
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetFlag-Number_Boolean
}{
Table Row (tr)
:
id
=
name
}{td}h6.setFlag{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
setFlag
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
setFlag
{span}{span}\
Span
(flag,
set)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Set or clear a flag of a new column. The flags are a bit pattern consisting of 1 or more of the following bits: \- JSColumn.UUID\_COLUMN; \- JSColumn.EXCLUDED\_COLUMN;{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} flag -- the flag to set \{[Boolean]} set -- true for set flag, false for clear flag {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set or clear a flag of a new column.
The flags are a bit pattern consisting of 1 or more of the following bits:
- JSColumn.UUID_COLUMN;
- JSColumn.EXCLUDED_COLUMN;
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} flag – the flag to set
{Boolean} set – true for set flag, false for clear flag
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var server = plugins.maintenance.getServer("example_data");
if (server)
{
	var table = server.createNewTable("users");
	if (table)
	{
		var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use (JSColumn.TEXT, 36) for UUIDs
		pk.rowIdentifierType = JSColumn.PK_COLUMN;
		pk.setFlag(JSColumn.UUID_COLUMN, true)
		pk.sequenceType = JSColumn.UUID_GENERATOR
		var c = table.createNewColumn("name", JSColumn.TEXT, 100);
		c.allowNull = false
		table.createNewColumn("age", JSColumn.INTEGER, 0);
		table.createNewColumn("last_login", JSColumn.DATETIME, 0);
		var result = server.synchronizeWithDB(table);
		if (result) application.output("Table successfully created.");
		else application.output("Table not created.");
	}
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)