Skip to content

ExecuteQuery

Source: src/AWS/IoTSiteWise/ExecuteQuery.ts

Runtime binding for iotsitewise:ExecuteQuery — run a SiteWise SQL query across all asset models, assets, measurements, metrics, and transforms in the account from a deployed Lambda or Task.

The query surface is account-wide, so the binding grants the action on Resource: ["*"] and takes no bound resource.

Provide the ExecuteQueryHttp implementation layer on the Function effect, bind in the init phase (no resource argument), then call the returned client at runtime.

// init — account-level binding takes no resource
const executeQuery = yield* AWS.IoTSiteWise.ExecuteQuery();
// runtime
const { rows } = yield* executeQuery({
queryStatement:
"SELECT asset_id, asset_name FROM asset WHERE asset_name = 'Pump1'",
});
// on the Function effect:
// .pipe(Effect.provide(AWS.IoTSiteWise.ExecuteQueryHttp))