https://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
const result = await Resources.sql.create({
name: "Latest temperature",
query: "SELECT variable, value, time FROM device($1) AS d WHERE variable = 'temperature' ORDER BY time DESC LIMIT 10",
params: [{ key: "$1", value: "my-device-id" }],
});
console.log(result); // { id: 'query-id-123', name: 'Latest temperature', ... }
Deletes a TagoSQL query from your profile.
https://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
Replaces a TagoSQL query. The query is re-validated and its cached results are dropped; a new version is stored when the query or the params change.
https://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
Executes a TagoSQL query. Params sent here override the saved defaults per key;
test: true skips the result cache entirely.
OptionalexecuteObj: SQLExecuteObjhttps://docs.tago.io/docs/tagoio/tagosql/executing-queries Executing Queries
Retrieves a historical snapshot (query and params) of a TagoSQL query.
To restore it, send the snapshot's query and params back with edit.
https://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
Retrieves detailed information about a specific TagoSQL query.
https://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
Lists all TagoSQL queries from your profile with pagination support.
OptionalqueryObj: SQLQueryhttps://docs.tago.io/docs/tagoio/tagosql/queries TagoSQL Queries
Retrieves the TagoSQL schema discovery catalog: the virtual table families with
their typed columns, plus your devices and entities. Pass entity_id to resolve
one entity's columns.
OptionalqueryObj: SQLTablesQueryhttps://docs.tago.io/docs/tagoio/tagosql/tables Available Tables
Creates a new TagoSQL query on your profile.