Skip to main content
Version: Streamsheets 3.0

TIMESCALE.INSERT

Premium

Performs a STORE query on your Timescale database.

info

As of right now, the timescale functions work with the internal timescaledb. Leave the Connection parameter empty and the connection is automatically set up. We are working on allowing further timescale connections.

Syntax

=TIMESCALE.INSERT(Connection, TableName, ValuesJSON, [TableSchemaJSON])

Arguments

NameTypeDescription
ConnectionConnectionConnection to use for querying. Leave this parameter empty. The internal timescaledb is automatically connected.
TableNameStringName of the table to store values to. Note: its fully qualified name will be written to target range, if provided.
ValuesJSONJSONA JSON with key/value pairs to store.
TableSchemaJSON (optional)JSONThe timescale enforces the usage of a schema. If the used table is not already created, enter a JSON Range with a schema. Now for every new table the specified schema is setup. Supported schema values can be NUMERIC, TEXT, TIMESTAMP,, TIMESTAMPTZ, DATE, INTEGER etc. See here for detailed explanation.

Return

TypeDescription
BooleanTRUE, if successful.

Examples

AB
1Schema:
2CatsNUMERIC
3DogsNUMERIC
4
5Table:TimescaleDbTable
6Cats1
7Dogs94
FormulaResultComment
=TIMESCALE.INSERT(, B5, JSONAA6:B7), JSON(A2:B3))
TRUECreates a table with the given schema and stores the values in that table.
=TIMESCALE.INSERT(, "measures", { v1: "hello" })
TRUEStores "hello" under v1 in the "measures" table.

For more examples see our timescale tutorial.