Options
All
  • Public
  • Public/Protected
  • All
Menu

Data provided to Publisher.addColumnsFromJson used to add columns and data a data table. This works by including data from the target table as well as the data that you want to add and performing a SQL style join on the information in order to add it to the target table. e.g.

const data = {
columns: [
{
name: 'ID column from target table',
dataType: 'int',
},
{
name: 'New column 1',
dataType: 'string',
},
{
name: 'New column 2',
dataType: 'double',
},
],
data: [
[ 1, 'new data string', 28.2 ],
[ 2, 'another new data string', 28.2 ],
],
table: {
name: 'Target table',
},
}

In the example above the columns array contains a 'join' column as well as 2 new columns. The data 2D array contains 2 rows. Each row has 3 items, the order of the items in each row corresponds to the order of the columns. The first of the items in each row is used to perform the join with the target table in this case - the other 2 items in each row are added to the target table in the 2 new columns.

Hierarchy

  • AddColumnsRequest

Index

Properties

columns: { dataType: DataType; name: string; properties?: {} }[]

Array of columns to add to the target data table and at least one (or more) existing columns from the target data table. If multiple columns match column in the target table, all matching columns will be used in the join.

data: any[][]

Array of rows to add to the data table.

format?: "dataTable"

Ignore, this is automatically set by publisher.

joinType?: "InnerJoin" | "LeftOuterJoin" | "RightOuterJoin" | "FullOuterJoin" | "LeftSingleMatchJoin" | "RightSingleMatchJoin"

The way in which the data is joined with the target table. TODO This should be an enumerated type

table: { id?: string; name?: string }

The target table to which columns will be added defined by the table id or name - one of these must be provided. If both fields are provided, the id is used preferentially to find the table in the document.

Type declaration

  • Optional id?: string
  • Optional name?: string
version?: "1.0"

Ignore, this is automatically set by publisher.

Generated using TypeDoc