A Schema is an Entity that defines a set of columns in a table.

Format

An R6 class object.

Methods

  • Schema(name=NULL, columns=NULL, parent=NULL, properties=NULL, annotations=NULL, description=NULL): Constructor for Schema

  • addColumn(column): Adds a Column to the schema

  • addColumns(columns): Adds a list of Columns to the schema

  • has_columns(): Are there any Columns specified in the schema?

  • removeColumn(column): Removes a Column from the schema

Examples

if (FALSE) {
schema <- Schema(name='MyTable', parent=project)
schema$addColumn(Column(name='Isotope', columnType='STRING'))
cols <- c(Column(name='Atomic Mass', columnType='INTEGER'),
  Column(name='Halflife', columnType='DOUBLE'),
  Column(name='Discovered', columnType='DATE'))
schema$addColumns(cols)
schema$has_columns()
schema$removeColumn(Column(name='Discovered', columnType='DATE'))
schema <- synStore(schema)
}