PrepareQuery
Source:
src/AWS/Timestream/PrepareQuery.ts
Runtime binding for timestream-query:PrepareQuery — validate a SQL query
against a Timestream Table and inspect its result schema and
parameter mappings without running it.
Bind the operation to the table the SQL reads so the host is granted
timestream:PrepareQuery and timestream:Select on it (plus the unscoped
timestream:DescribeEndpoints the endpoint-discovery flow needs). The
query string itself still references the database and table by name.
Provide Timestream.PrepareQueryHttp on the Function to implement the
binding.
Querying Data
Section titled “Querying Data”// init — bind the operation to the table the SQL readsconst prepareQuery = yield* Timestream.PrepareQuery(table);
// runtime — validate only; Columns/Parameters describe the result shapeconst prepared = yield* prepareQuery({ QueryString: `SELECT COUNT(*) AS c FROM "${databaseName}"."${tableName}"`, ValidateOnly: true,});// prepared.Columns[0].Name === "c"