Skip to content

PreparedStatement

Source: src/AWS/Athena/PreparedStatement.ts

An Amazon Athena prepared statement — a named, parameterized SQL statement saved in a workgroup and run with EXECUTE name USING .... Identity is the (workGroup, statementName) pair; the queryStatement and description are updatable in place.

const stmt = yield* AWS.Athena.PreparedStatement("TopN", {
workGroup: wg.workGroupName,
queryStatement: "SELECT * FROM analytics.orders WHERE customer_id = ?",
});
// then at runtime: EXECUTE <stmt.statementName> USING 'customer-123'