AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: AWS.RedshiftData

Inherits:
AWS.Service show all
Identifier:
redshiftdata
API Version:
2019-12-20
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You can run individual SQL statements, which are committed if the statement succeeds.

Sending a Request Using RedshiftData

var redshiftdata = new AWS.RedshiftData();
redshiftdata.cancelStatement(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the RedshiftData object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var redshiftdata = new AWS.RedshiftData({apiVersion: '2019-12-20'});

You can also set the API version globally in AWS.config.apiVersions using the redshiftdata service identifier:

AWS.config.apiVersions = {
  redshiftdata: '2019-12-20',
  // other service API versions
};

var redshiftdata = new AWS.RedshiftData();

Version:

  • 2019-12-20

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.RedshiftData(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a RedshiftData object

var redshiftdata = new AWS.RedshiftData({apiVersion: '2019-12-20'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.RedshiftData.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.RedshiftData.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.RedshiftData.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

cancelStatement(params = {}, callback) ⇒ AWS.Request

Cancels a running query. To be canceled, a query must be running.

Service Reference:

Examples:

Calling the cancelStatement operation

var params = {
  Id: 'STRING_VALUE' /* required */
};
redshiftdata.cancelStatement(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Id — (String)

      The identifier of the SQL statement to cancel. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Status — (Boolean)

        A value that indicates whether the cancel statement succeeded (true).

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeStatement(params = {}, callback) ⇒ AWS.Request

Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.

Service Reference:

Examples:

Calling the describeStatement operation

var params = {
  Id: 'STRING_VALUE' /* required */
};
redshiftdata.describeStatement(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Id — (String)

      The identifier of the SQL statement to describe. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ClusterIdentifier — (String)

        The cluster identifier.

      • CreatedAt — (Date)

        The date and time (UTC) when the SQL statement was submitted to run.

      • Database — (String)

        The name of the database.

      • DbUser — (String)

        The database user name.

      • Duration — (Integer)

        The amount of time in nanoseconds that the statement ran.

      • Error — (String)

        The error message from the cluster if the SQL statement encountered an error while running.

      • Id — (String)

        The identifier of the SQL statement described. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

      • QueryString — (String)

        The SQL statement text.

      • RedshiftPid — (Integer)

        The process identifier from Amazon Redshift.

      • RedshiftQueryId — (Integer)

        The identifier of the query generated by Amazon Redshift. These identifiers are also available in the query column of the STL_QUERY system view.

      • ResultRows — (Integer)

        Either the number of rows returned from the SQL statement or the number of rows affected. If result size is greater than zero, the result rows can be the number of rows affected by SQL statements such as INSERT, UPDATE, DELETE, COPY, and others.

      • ResultSize — (Integer)

        The size in bytes of the returned results.

      • SecretArn — (String)

        The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

      • Status — (String)

        The status of the SQL statement being described. Status values are defined as follows:

        • ABORTED - The query run was stopped by the user.

        • ALL - A status value that includes all query statuses. This value can be used to filter results.

        • FAILED - The query run failed.

        • FINISHED - The query has finished running.

        • PICKED - The query has been chosen to be run.

        • STARTED - The query run has started.

        • SUBMITTED - The query was submitted, but not yet processed.

        Possible values include:
        • "ABORTED"
        • "ALL"
        • "FAILED"
        • "FINISHED"
        • "PICKED"
        • "STARTED"
        • "SUBMITTED"
      • UpdatedAt — (Date)

        The date and time (UTC) that the metadata for the SQL statement was last updated. An example is the time the status last changed.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTable(params = {}, callback) ⇒ AWS.Request

Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:

  • AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the secret and the cluster identifier that matches the cluster in the secret.

  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.

Service Reference:

Examples:

Calling the describeTable operation

var params = {
  ClusterIdentifier: 'STRING_VALUE', /* required */
  Database: 'STRING_VALUE',
  DbUser: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  Schema: 'STRING_VALUE',
  SecretArn: 'STRING_VALUE',
  Table: 'STRING_VALUE'
};
redshiftdata.describeTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClusterIdentifier — (String)

      The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.

    • Database — (String)

      The name of the database. This parameter is required when authenticating using temporary credentials.

    • DbUser — (String)

      The database user name. This parameter is required when authenticating using temporary credentials.

    • MaxResults — (Integer)

      The maximum number of tables to return in the response. If more tables exist than fit in one response, then NextToken is returned to page through the results.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

    • Schema — (String)

      The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.

    • SecretArn — (String)

      The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.

    • Table — (String)

      The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ColumnList — (Array<map>)

        A list of columns in the table.

        • columnDefault — (String)

          The default value of the column.

        • isCaseSensitive — (Boolean)

          A value that indicates whether the column is case-sensitive.

        • isCurrency — (Boolean)

          A value that indicates whether the column contains currency values.

        • isSigned — (Boolean)

          A value that indicates whether an integer column is signed.

        • label — (String)

          The label for the column.

        • length — (Integer)

          The length of the column.

        • name — (String)

          The name of the column.

        • nullable — (Integer)

          A value that indicates whether the column is nullable.

        • precision — (Integer)

          The precision value of a decimal number column.

        • scale — (Integer)

          The scale value of a decimal number column.

        • schemaName — (String)

          The name of the schema that contains the table that includes the column.

        • tableName — (String)

          The name of the table that includes the column.

        • typeName — (String)

          The database-specific data type of the column.

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

      • TableName — (String)

        The table name.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

executeStatement(params = {}, callback) ⇒ AWS.Request

Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:

  • AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the secret and the cluster identifier that matches the cluster in the secret.

  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.

Service Reference:

Examples:

Calling the executeStatement operation

var params = {
  ClusterIdentifier: 'STRING_VALUE', /* required */
  Sql: 'STRING_VALUE', /* required */
  Database: 'STRING_VALUE',
  DbUser: 'STRING_VALUE',
  SecretArn: 'STRING_VALUE',
  StatementName: 'STRING_VALUE',
  WithEvent: true || false
};
redshiftdata.executeStatement(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClusterIdentifier — (String)

      The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.

    • Database — (String)

      The name of the database. This parameter is required when authenticating using temporary credentials.

    • DbUser — (String)

      The database user name. This parameter is required when authenticating using temporary credentials.

    • SecretArn — (String)

      The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.

    • Sql — (String)

      The SQL statement text to run.

    • StatementName — (String)

      The name of the SQL statement. You can name the SQL statement when you create it to identify the query.

    • WithEvent — (Boolean)

      A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ClusterIdentifier — (String)

        The cluster identifier.

      • CreatedAt — (Date)

        The date and time (UTC) the statement was created.

      • Database — (String)

        The name of the database.

      • DbUser — (String)

        The database user name.

      • Id — (String)

        The identifier of the statement to be run. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

      • SecretArn — (String)

        The name or ARN of the secret that enables access to the database.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getStatementResult(params = {}, callback) ⇒ AWS.Request

Fetches the temporarily cached result of an SQL statement. A token is returned to page through the statement results.

Service Reference:

Examples:

Calling the getStatementResult operation

var params = {
  Id: 'STRING_VALUE', /* required */
  NextToken: 'STRING_VALUE'
};
redshiftdata.getStatementResult(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Id — (String)

      The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by ExecuteStatment and ListStatements.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ColumnMetadata — (Array<map>)

        The properties (metadata) of a column.

        • columnDefault — (String)

          The default value of the column.

        • isCaseSensitive — (Boolean)

          A value that indicates whether the column is case-sensitive.

        • isCurrency — (Boolean)

          A value that indicates whether the column contains currency values.

        • isSigned — (Boolean)

          A value that indicates whether an integer column is signed.

        • label — (String)

          The label for the column.

        • length — (Integer)

          The length of the column.

        • name — (String)

          The name of the column.

        • nullable — (Integer)

          A value that indicates whether the column is nullable.

        • precision — (Integer)

          The precision value of a decimal number column.

        • scale — (Integer)

          The scale value of a decimal number column.

        • schemaName — (String)

          The name of the schema that contains the table that includes the column.

        • tableName — (String)

          The name of the table that includes the column.

        • typeName — (String)

          The database-specific data type of the column.

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

      • Records — (Array<Array<map>>)

        The results of the SQL statement.

        • blobValue — (Buffer, Typed Array, Blob, String)

          A value of the BLOB data type.

        • booleanValue — (Boolean)

          A value of the Boolean data type.

        • doubleValue — (Float)

          A value of the double data type.

        • isNull — (Boolean)

          A value that indicates whether the data is NULL.

        • longValue — (Integer)

          A value of the long data type.

        • stringValue — (String)

          A value of the string data type.

      • TotalNumRows — (Integer)

        The total number of rows in the result set returned from a query. You can use this number to estimate the number of calls to the GetStatementResult operation needed to page through the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDatabases(params = {}, callback) ⇒ AWS.Request

List the databases in a cluster. A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:

  • AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the secret and the cluster identifier that matches the cluster in the secret.

  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.

Service Reference:

Examples:

Calling the listDatabases operation

var params = {
  ClusterIdentifier: 'STRING_VALUE', /* required */
  Database: 'STRING_VALUE',
  DbUser: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  SecretArn: 'STRING_VALUE'
};
redshiftdata.listDatabases(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClusterIdentifier — (String)

      The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.

    • Database — (String)

      The name of the database. This parameter is required when authenticating using temporary credentials.

    • DbUser — (String)

      The database user name. This parameter is required when authenticating using temporary credentials.

    • MaxResults — (Integer)

      The maximum number of databases to return in the response. If more databases exist than fit in one response, then NextToken is returned to page through the results.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

    • SecretArn — (String)

      The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Databases — (Array<String>)

        The names of databases.

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listSchemas(params = {}, callback) ⇒ AWS.Request

Lists the schemas in a database. A token is returned to page through the schema list. Depending on the authorization method, use one of the following combinations of request parameters:

  • AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the secret and the cluster identifier that matches the cluster in the secret.

  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.

Service Reference:

Examples:

Calling the listSchemas operation

var params = {
  ClusterIdentifier: 'STRING_VALUE', /* required */
  Database: 'STRING_VALUE', /* required */
  DbUser: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  SchemaPattern: 'STRING_VALUE',
  SecretArn: 'STRING_VALUE'
};
redshiftdata.listSchemas(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClusterIdentifier — (String)

      The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.

    • Database — (String)

      The name of the database. This parameter is required when authenticating using temporary credentials.

    • DbUser — (String)

      The database user name. This parameter is required when authenticating using temporary credentials.

    • MaxResults — (Integer)

      The maximum number of schemas to return in the response. If more schemas exist than fit in one response, then NextToken is returned to page through the results.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

    • SchemaPattern — (String)

      A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned.

    • SecretArn — (String)

      The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

      • Schemas — (Array<String>)

        The schemas that match the request pattern.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listStatements(params = {}, callback) ⇒ AWS.Request

List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list.

Service Reference:

Examples:

Calling the listStatements operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  StatementName: 'STRING_VALUE',
  Status: ABORTED | ALL | FAILED | FINISHED | PICKED | STARTED | SUBMITTED
};
redshiftdata.listStatements(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • MaxResults — (Integer)

      The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then NextToken is returned to page through the results.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

    • StatementName — (String)

      The name of the SQL statement specified as input to ExecuteStatement to identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value of myStatement. Data API does a case-sensitive match of SQL statement names to the prefix value you provide.

    • Status — (String)

      The status of the SQL statement to list. Status values are defined as follows:

      • ABORTED - The query run was stopped by the user.

      • ALL - A status value that includes all query statuses. This value can be used to filter results.

      • FAILED - The query run failed.

      • FINISHED - The query has finished running.

      • PICKED - The query has been chosen to be run.

      • STARTED - The query run has started.

      • SUBMITTED - The query was submitted, but not yet processed.

      Possible values include:
      • "ABORTED"
      • "ALL"
      • "FAILED"
      • "FINISHED"
      • "PICKED"
      • "STARTED"
      • "SUBMITTED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

      • Statements — (Array<map>)

        The SQL statements.

        • CreatedAt — (Date)

          The date and time (UTC) the statement was created.

        • Idrequired — (String)

          The SQL statement identifier. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

        • QueryString — (String)

          The SQL statement.

        • SecretArn — (String)

          The name or Amazon Resource Name (ARN) of the secret that enables access to the database.

        • StatementName — (String)

          The name of the SQL statement.

        • Status — (String)

          The status of the SQL statement. An example is the that the SQL statement finished.

          Possible values include:
          • "ABORTED"
          • "ALL"
          • "FAILED"
          • "FINISHED"
          • "PICKED"
          • "STARTED"
          • "SUBMITTED"
        • UpdatedAt — (Date)

          The date and time (UTC) that the statement metadata was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTables(params = {}, callback) ⇒ AWS.Request

List the tables in a database. If neither SchemaPattern nor TablePattern are specified, then all tables in the database are returned. A token is returned to page through the table list. Depending on the authorization method, use one of the following combinations of request parameters:

  • AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the secret and the cluster identifier that matches the cluster in the secret.

  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.

Service Reference:

Examples:

Calling the listTables operation

var params = {
  ClusterIdentifier: 'STRING_VALUE', /* required */
  Database: 'STRING_VALUE', /* required */
  DbUser: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  SchemaPattern: 'STRING_VALUE',
  SecretArn: 'STRING_VALUE',
  TablePattern: 'STRING_VALUE'
};
redshiftdata.listTables(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClusterIdentifier — (String)

      The cluster identifier. This parameter is required when authenticating using either AWS Secrets Manager or temporary credentials.

    • Database — (String)

      The name of the database. This parameter is required when authenticating using temporary credentials.

    • DbUser — (String)

      The database user name. This parameter is required when authenticating using temporary credentials.

    • MaxResults — (Integer)

      The maximum number of tables to return in the response. If more tables exist than fit in one response, then NextToken is returned to page through the results.

    • NextToken — (String)

      A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

    • SchemaPattern — (String)

      A pattern to filter results by schema name. Within a schema pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only schema name entries matching the search pattern are returned. If SchemaPattern is not specified, then all tables that match TablePattern are returned. If neither SchemaPattern or TablePattern are specified, then all tables are returned.

    • SecretArn — (String)

      The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using AWS Secrets Manager.

    • TablePattern — (String)

      A pattern to filter results by table name. Within a table pattern, "%" means match any substring of 0 or more characters and "_" means match any one character. Only table name entries matching the search pattern are returned. If TablePattern is not specified, then all tables that match SchemaPatternare returned. If neither SchemaPattern or TablePattern are specified, then all tables are returned.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.

      • Tables — (Array<map>)

        The tables that match the request pattern.

        • name — (String)

          The name of the table.

        • schema — (String)

          The schema containing the table.

        • type — (String)

          The type of the table. Possible values include TABLE, VIEW, SYSTEM TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, and SYNONYM.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.