Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Execute queries on Amazon Redshift using the AWS SDK for JavaScript

I have been following aws-sdk for javascript to execute sql queries on redshift cluster but haven't been able to connect.

Can someone guide me regarding module to use for redshift connection in javascript (except node-redshift) or share a skeleton code with proper parameter names?

Using @aws-sdk/client-redshift

const RedShiftClient = new RedshiftClient({region:'us-west-2'});
const params = {
  ClusterIdentified:'clustername-xxx-aws.com',
  NodeType: 'nodetype',
  MasterUsername:'user',
  MasterPassword:'password',
  ClusterType:'clustertype'
};

const command = new AcceptReservedNodeExchangeCommand(params);
redshiftClient.send(command)
.then(res=>{
//dosomething
})
.catch(err=>{
console.log(err);
});

Receiving error : 2 validation errors found: Value null at 'targeReservedNodeOfferingId' failed to satisfy constraint. Member cannot be null. Value null at 'reserverNodeId' failed to satify constraint. Member cannot be null.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To execute queries on Amazon Redshift using JavaScript, use RedshiftDataClient (not RedShiftClient ). There are examples in the previous link. This is part of the AWS SDK for JavaScript v3.

To use a RedshiftDataClient object to query data, you can use the following Amazon Redshift values:

  • The name of the database (for example, dev)
  • The name of the database user that you configured
  • The name of the Amazon Redshift cluster (for example, redshift-cluster-1)

These values are used when creating an ExecuteStatementCommand as discussed here:

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-redshift-data/classes/executestatementcommand.html

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!