createPreparedStatement method

Future<void> createPreparedStatement({
  1. required String queryStatement,
  2. required String statementName,
  3. required String workGroup,
  4. String? description,
})

Creates a prepared statement for use with SQL queries in Athena.

May throw InternalServerException. May throw InvalidRequestException.

Parameter queryStatement : The query string for the prepared statement.

Parameter statementName : The name of the prepared statement.

Parameter workGroup : The name of the workgroup to which the prepared statement belongs.

Parameter description : The description of the prepared statement.

Implementation

Future<void> createPreparedStatement({
  required String queryStatement,
  required String statementName,
  required String workGroup,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.CreatePreparedStatement'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QueryStatement': queryStatement,
      'StatementName': statementName,
      'WorkGroup': workGroup,
      if (description != null) 'Description': description,
    },
  );
}