Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-redshift-data

Package Overview
Dependencies
Maintainers
0
Versions
378
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-redshift-data

AWS SDK for JavaScript Redshift Data Client for Node.js, Browser and React Native

  • 3.709.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
129K
increased by2.11%
Maintainers
0
Weekly downloads
 
Created

What is @aws-sdk/client-redshift-data?

@aws-sdk/client-redshift-data is an AWS SDK for JavaScript package that allows you to interact with Amazon Redshift Data API. This package provides functionalities to execute SQL commands, manage database connections, and retrieve query results from Amazon Redshift clusters.

What are @aws-sdk/client-redshift-data's main functionalities?

Execute SQL Statements

This feature allows you to execute SQL statements on your Amazon Redshift cluster. The code sample demonstrates how to execute a simple SELECT query.

const { RedshiftDataClient, ExecuteStatementCommand } = require('@aws-sdk/client-redshift-data');

const client = new RedshiftDataClient({ region: 'us-west-2' });

const params = {
  ClusterIdentifier: 'my-cluster',
  Database: 'my-database',
  Sql: 'SELECT * FROM my_table',
  DbUser: 'my-db-user'
};

const command = new ExecuteStatementCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Retrieve Query Results

This feature allows you to retrieve the results of a previously executed SQL statement. The code sample demonstrates how to get the results using the statement ID.

const { RedshiftDataClient, GetStatementResultCommand } = require('@aws-sdk/client-redshift-data');

const client = new RedshiftDataClient({ region: 'us-west-2' });

const params = {
  Id: 'statement-id'
};

const command = new GetStatementResultCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

List Databases

This feature allows you to list all databases in your Amazon Redshift cluster. The code sample demonstrates how to list databases using the cluster identifier and database user.

const { RedshiftDataClient, ListDatabasesCommand } = require('@aws-sdk/client-redshift-data');

const client = new RedshiftDataClient({ region: 'us-west-2' });

const params = {
  ClusterIdentifier: 'my-cluster',
  DbUser: 'my-db-user'
};

const command = new ListDatabasesCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

List Tables

This feature allows you to list all tables in a specified database within your Amazon Redshift cluster. The code sample demonstrates how to list tables using the cluster identifier, database name, and database user.

const { RedshiftDataClient, ListTablesCommand } = require('@aws-sdk/client-redshift-data');

const client = new RedshiftDataClient({ region: 'us-west-2' });

const params = {
  ClusterIdentifier: 'my-cluster',
  Database: 'my-database',
  DbUser: 'my-db-user'
};

const command = new ListTablesCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Other packages similar to @aws-sdk/client-redshift-data

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc