1- const { AthenaClient, StartQueryExecutionCommand, CreateNamedQueryCommand, UpdateNamedQueryCommand } = require ( "@aws-sdk/client-athena" ) ;
1+ const { AthenaClient, StartQueryExecutionCommand, CreateNamedQueryCommand, UpdateNamedQueryCommand, CreatePreparedStatementCommand } = require ( "@aws-sdk/client-athena" ) ;
22const AWS = require ( 'aws-sdk' ) ;
33const express = require ( 'express' ) ;
44const bodyParser = require ( 'body-parser' ) ;
@@ -10,7 +10,7 @@ app.post('/v3/athena/all', async (req, res) => {
1010
1111 const client = new AthenaClient ( { region : "us-east-1" } ) ;
1212
13- const params1 = {
13+ const params1 = {
1414 QueryString : "SQL" + userQuery ,
1515 QueryExecutionContext : { Database : "default" } ,
1616 ResultConfiguration : { OutputLocation : "s3://my-results/" }
@@ -70,3 +70,16 @@ app.post('/v2/athena/all', async (req, res) => {
7070
7171 res . end ( ) ;
7272} ) ;
73+
74+ app . post ( '/dynamodb-v3' , async ( req , res ) => {
75+ const userQueryStatement = req . body . query ; // $ MISSING: Source
76+ const client = new AthenaClient ( { region : "us-east-1" } ) ;
77+ const input = {
78+ StatementName : "STRING_VALUE" ,
79+ WorkGroup : "STRING_VALUE" ,
80+ QueryStatement : userQueryStatement ,
81+ Description : "STRING_VALUE" ,
82+ } ;
83+ const command = new CreatePreparedStatementCommand ( input ) ;
84+ await client . send ( command ) ; // $ MISSING: Alert
85+ } ) ;
0 commit comments