JSTable

Overview

The JSTable represents a database table object used in Servoy, accessible through the maintenance plugin or the databaseManager. It provides functionality for interacting with table metadata, columns, and related properties within a database. This object allows developers to retrieve table-specific details such as the SQL name, quoted identifiers, server name, and the table's data source URI.

Functionality

JSTable supports accessing column data, including retrieving names of all columns or primary key columns in a table. Developers can obtain a specific column as a JSColumn object or determine if a table is marked as a metadata table. Additionally, table attributes like the SQL name and quoted SQL name can be utilized for database queries or raw SQL operations.

Methods Summarized

Type
Name
Summary

Returns a JSColumn for the named column (or column dataproviderID).

Returns an array containing the names of all table columns.

Returns the table data source uri.

Returns a quoted version of the table name, if necessary, as defined by the actual database used.

Returns an array containing the names of the identifier (PK) column(s).

Returns the table name as defined in the database.

Returns the Servoy server name.

Returns whether table was flagged as metadata table.

Methods Detailed

getColumn(name)

Returns a JSColumn for the named column (or column dataproviderID).

Parameters

  • String name The name of the column to return the value from.

Returns: JSColumn JSColumn column.

Sample

getColumnNames()

Returns an array containing the names of all table columns. If the table is in mem, then the internal rowid column name is not returned.

Returns: Array String array of column names.

Sample

getDataSource()

Returns the table data source uri.

Returns: String String datasource uri.

Sample

getQuotedSQLName()

Returns a quoted version of the table name, if necessary, as defined by the actual database used.

Returns: String String table name, quoted if needed.

Sample

getRowIdentifierColumnNames()

Returns an array containing the names of the identifier (PK) column(s). Please note that if the table is in mem, then the internal rowid column name is also returned.

Returns: Array String array of row identifier column names.

Sample

getSQLName()

Returns the table name as defined in the database.

Returns: String String table sql name.

Sample

getServerName()

Returns the Servoy server name.

Returns: String String server name.

Sample

isMetadataTable()

Returns whether table was flagged as metadata table.

Returns: Boolean boolean is metadata

Sample


Last updated

Was this helpful?