We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.RDSDataService

Inherits:
AWS.Service show all
Identifier:
rdsdataservice
API Version:
2018-08-01
Defined in:
(unknown)

Overview

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

Service Description

Amazon RDS provides an HTTP endpoint to run SQL statements on an Amazon Aurora DB cluster. To run these statements, you use the RDS Data API (Data API).

Data API is available with the following types of Aurora databases:

  • Aurora PostgreSQL - Serverless v2, Serverless v1, and provisioned

  • Aurora MySQL - Serverless v1 only

For more information about the Data API, see Using RDS Data API in the Amazon Aurora User Guide.

Sending a Request Using RDSDataService

var rdsdataservice = new AWS.RDSDataService();
rdsdataservice.batchExecuteStatement(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 RDSDataService object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var rdsdataservice = new AWS.RDSDataService({apiVersion: '2018-08-01'});

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

AWS.config.apiVersions = {
  rdsdataservice: '2018-08-01',
  // other service API versions
};

var rdsdataservice = new AWS.RDSDataService();

Version:

  • 2018-08-01

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.RDSDataService(options = {}) ⇒ Object

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

Examples:

Constructing a RDSDataService object

var rdsdataservice = new AWS.RDSDataService({apiVersion: '2018-08-01'});

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|AWS.Endpoint)

    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' or an Endpoint object.

  • 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.RDSDataService.region for more information.

  • maxRetries (Integer)

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

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.RDSDataService.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. The function is only called for retryable errors.
  • 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'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

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

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

Runs a batch SQL statement over an array of data.

You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.

Note: If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set. The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.

Service Reference:

Examples:

Calling the batchExecuteStatement operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  secretArn: 'STRING_VALUE', /* required */
  sql: 'STRING_VALUE', /* required */
  database: 'STRING_VALUE',
  parameterSets: [
    [
      {
        name: 'STRING_VALUE',
        typeHint: JSON | UUID | TIMESTAMP | DATE | TIME | DECIMAL,
        value: {
          arrayValue: { /* ArrayValue */
            arrayValues: [
              /* recursive ArrayValue */,
              /* more items */
            ],
            booleanValues: [
              true || false,
              /* more items */
            ],
            doubleValues: [
              'NUMBER_VALUE',
              /* more items */
            ],
            longValues: [
              'NUMBER_VALUE',
              /* more items */
            ],
            stringValues: [
              'STRING_VALUE',
              /* more items */
            ]
          },
          blobValue: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
          booleanValue: true || false,
          doubleValue: 'NUMBER_VALUE',
          isNull: true || false,
          longValue: 'NUMBER_VALUE',
          stringValue: 'STRING_VALUE'
        }
      },
      /* more items */
    ],
    /* more items */
  ],
  schema: 'STRING_VALUE',
  transactionId: 'STRING_VALUE'
};
rdsdataservice.batchExecuteStatement(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

    • secretArn — (String)

      The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

      For information about creating the secret, see Create a database secret.

    • sql — (String)

      The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement.

    • database — (String)

      The name of the database.

    • schema — (String)

      The name of the database schema.

      Note: Currently, the schema parameter isn't supported.
    • parameterSets — (Array<Array<map>>)

      The parameter set for the batch operation.

      The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options:

      • Specify one or more empty parameter sets.

      • Use the ExecuteStatement operation instead of the BatchExecuteStatement operation.

      Note: Array parameters are not supported.
      • name — (String)

        The name of the parameter.

      • value — (map)

        The value of the parameter.

        • isNull — (Boolean)

          A NULL value.

        • booleanValue — (Boolean)

          A value of Boolean data type.

        • longValue — (Integer)

          A value of long data type.

        • doubleValue — (Float)

          A value of double data type.

        • stringValue — (String)

          A value of string data type.

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

          A value of BLOB data type.

        • arrayValue — (map)

          An array of values.

          • booleanValues — (Array<Boolean>)

            An array of Boolean values.

          • longValues — (Array<Integer>)

            An array of integers.

          • doubleValues — (Array<Float>)

            An array of floating-point numbers.

          • stringValues — (Array<String>)

            An array of strings.

          • arrayValues — (Array<map>)

            An array of arrays.

      • typeHint — (String)

        A hint that specifies the correct object type for data type mapping. Possible values are as follows:

        • DATE - The corresponding String parameter value is sent as an object of DATE type to the database. The accepted format is YYYY-MM-DD.

        • DECIMAL - The corresponding String parameter value is sent as an object of DECIMAL type to the database.

        • JSON - The corresponding String parameter value is sent as an object of JSON type to the database.

        • TIME - The corresponding String parameter value is sent as an object of TIME type to the database. The accepted format is HH:MM:SS[.FFF].

        • TIMESTAMP - The corresponding String parameter value is sent as an object of TIMESTAMP type to the database. The accepted format is YYYY-MM-DD HH:MM:SS[.FFF].

        • UUID - The corresponding String parameter value is sent as an object of UUID type to the database.

        Possible values include:
        • "JSON"
        • "UUID"
        • "TIMESTAMP"
        • "DATE"
        • "TIME"
        • "DECIMAL"
    • transactionId — (String)

      The identifier of a transaction that was started by using the BeginTransaction operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.

      If the SQL statement is not part of a transaction, don't set this parameter.

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:

      • updateResults — (Array<map>)

        The execution results of each batch entry.

        • generatedFields — (Array<map>)

          Values for fields generated during the request.

          • isNull — (Boolean)

            A NULL value.

          • booleanValue — (Boolean)

            A value of Boolean data type.

          • longValue — (Integer)

            A value of long data type.

          • doubleValue — (Float)

            A value of double data type.

          • stringValue — (String)

            A value of string data type.

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

            A value of BLOB data type.

          • arrayValue — (map)

            An array of values.

            • booleanValues — (Array<Boolean>)

              An array of Boolean values.

            • longValues — (Array<Integer>)

              An array of integers.

            • doubleValues — (Array<Float>)

              An array of floating-point numbers.

            • stringValues — (Array<String>)

              An array of strings.

            • arrayValues — (Array<map>)

              An array of arrays.

Returns:

  • (AWS.Request)

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

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

Starts a SQL transaction.

Note: A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours. A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically. DDL statements inside a transaction cause an implicit commit. We recommend that you run each DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.

Service Reference:

Examples:

Calling the beginTransaction operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  secretArn: 'STRING_VALUE', /* required */
  database: 'STRING_VALUE',
  schema: 'STRING_VALUE'
};
rdsdataservice.beginTransaction(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

    • secretArn — (String)

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

    • database — (String)

      The name of the database.

    • schema — (String)

      The name of the database schema.

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:

      • transactionId — (String)

        The transaction ID of the transaction started by the call.

Returns:

  • (AWS.Request)

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

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

Ends a SQL transaction started with the BeginTransaction operation and commits the changes.

Service Reference:

Examples:

Calling the commitTransaction operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  secretArn: 'STRING_VALUE', /* required */
  transactionId: 'STRING_VALUE' /* required */
};
rdsdataservice.commitTransaction(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

    • secretArn — (String)

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

    • transactionId — (String)

      The identifier of the transaction to end and commit.

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:

      • transactionStatus — (String)

        The status of the commit operation.

Returns:

  • (AWS.Request)

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

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

Runs one or more SQL statements.

Note: This operation isn't supported for Aurora PostgreSQL Serverless v2 and provisioned DB clusters, and for Aurora Serverless v1 DB clusters, the operation is deprecated. Use the BatchExecuteStatement or ExecuteStatement operation.

Service Reference:

Examples:

Calling the executeSql operation

var params = {
  awsSecretStoreArn: 'STRING_VALUE', /* required */
  dbClusterOrInstanceArn: 'STRING_VALUE', /* required */
  sqlStatements: 'STRING_VALUE', /* required */
  database: 'STRING_VALUE',
  schema: 'STRING_VALUE'
};
rdsdataservice.executeSql(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: {})
    • dbClusterOrInstanceArn — (String)

      The ARN of the Aurora Serverless DB cluster.

    • awsSecretStoreArn — (String)

      The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

      For information about creating the secret, see Create a database secret.

    • sqlStatements — (String)

      One or more SQL statements to run on the DB cluster.

      You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements.

    • database — (String)

      The name of the database.

    • schema — (String)

      The name of the database schema.

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:

      • sqlStatementResults — (Array<map>)

        The results of the SQL statement or statements.

        • resultFrame — (map)

          The result set of the SQL statement.

          • resultSetMetadata — (map)

            The result-set metadata in the result set.

            • columnCount — (Integer)

              The number of columns in the result set.

            • columnMetadata — (Array<map>)

              The metadata of the columns in the result set.

              • name — (String)

                The name of the column.

              • type — (Integer)

                The type of the column.

              • typeName — (String)

                The database-specific data type of the column.

              • label — (String)

                The label for the column.

              • schemaName — (String)

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

              • tableName — (String)

                The name of the table that includes the column.

              • isAutoIncrement — (Boolean)

                A value that indicates whether the column increments automatically.

              • isSigned — (Boolean)

                A value that indicates whether an integer column is signed.

              • isCurrency — (Boolean)

                A value that indicates whether the column contains currency values.

              • isCaseSensitive — (Boolean)

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

              • 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.

              • arrayBaseColumnType — (Integer)

                The type of the column.

          • records — (Array<map>)

            The records in the result set.

            • values — (Array<map>)

              The values returned in the record.

              • isNull — (Boolean)

                A NULL value.

              • bitValue — (Boolean)

                A value for a column of BIT data type.

              • bigIntValue — (Integer)

                A value for a column of big integer data type.

              • intValue — (Integer)

                A value for a column of integer data type.

              • doubleValue — (Float)

                A value for a column of double data type.

              • realValue — (Float)

                A value for a column of real data type.

              • stringValue — (String)

                A value for a column of string data type.

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

                A value for a column of BLOB data type.

              • arrayValues — (Array<map>)

                An array of column values.

              • structValue — (map)

                A value for a column of STRUCT data type.

                • attributes — (Array<map>)

                  The attributes returned in the record.

        • numberOfRecordsUpdated — (Integer)

          The number of records updated by a SQL statement.

Returns:

  • (AWS.Request)

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

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

Runs a SQL statement against a database.

Note: If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. If the binary response data from the database is more than 1 MB, the call is terminated.

Service Reference:

Examples:

Calling the executeStatement operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  secretArn: 'STRING_VALUE', /* required */
  sql: 'STRING_VALUE', /* required */
  continueAfterTimeout: true || false,
  database: 'STRING_VALUE',
  formatRecordsAs: NONE | JSON,
  includeResultMetadata: true || false,
  parameters: [
    {
      name: 'STRING_VALUE',
      typeHint: JSON | UUID | TIMESTAMP | DATE | TIME | DECIMAL,
      value: {
        arrayValue: { /* ArrayValue */
          arrayValues: [
            /* recursive ArrayValue */,
            /* more items */
          ],
          booleanValues: [
            true || false,
            /* more items */
          ],
          doubleValues: [
            'NUMBER_VALUE',
            /* more items */
          ],
          longValues: [
            'NUMBER_VALUE',
            /* more items */
          ],
          stringValues: [
            'STRING_VALUE',
            /* more items */
          ]
        },
        blobValue: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        booleanValue: true || false,
        doubleValue: 'NUMBER_VALUE',
        isNull: true || false,
        longValue: 'NUMBER_VALUE',
        stringValue: 'STRING_VALUE'
      }
    },
    /* more items */
  ],
  resultSetOptions: {
    decimalReturnType: STRING | DOUBLE_OR_LONG,
    longReturnType: STRING | LONG
  },
  schema: 'STRING_VALUE',
  transactionId: 'STRING_VALUE'
};
rdsdataservice.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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

    • secretArn — (String)

      The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret.

      For information about creating the secret, see Create a database secret.

    • sql — (String)

      The SQL statement to run.

    • database — (String)

      The name of the database.

    • schema — (String)

      The name of the database schema.

      Note: Currently, the schema parameter isn't supported.
    • parameters — (Array<map>)

      The parameters for the SQL statement.

      Note: Array parameters are not supported.
      • name — (String)

        The name of the parameter.

      • value — (map)

        The value of the parameter.

        • isNull — (Boolean)

          A NULL value.

        • booleanValue — (Boolean)

          A value of Boolean data type.

        • longValue — (Integer)

          A value of long data type.

        • doubleValue — (Float)

          A value of double data type.

        • stringValue — (String)

          A value of string data type.

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

          A value of BLOB data type.

        • arrayValue — (map)

          An array of values.

          • booleanValues — (Array<Boolean>)

            An array of Boolean values.

          • longValues — (Array<Integer>)

            An array of integers.

          • doubleValues — (Array<Float>)

            An array of floating-point numbers.

          • stringValues — (Array<String>)

            An array of strings.

          • arrayValues — (Array<map>)

            An array of arrays.

      • typeHint — (String)

        A hint that specifies the correct object type for data type mapping. Possible values are as follows:

        • DATE - The corresponding String parameter value is sent as an object of DATE type to the database. The accepted format is YYYY-MM-DD.

        • DECIMAL - The corresponding String parameter value is sent as an object of DECIMAL type to the database.

        • JSON - The corresponding String parameter value is sent as an object of JSON type to the database.

        • TIME - The corresponding String parameter value is sent as an object of TIME type to the database. The accepted format is HH:MM:SS[.FFF].

        • TIMESTAMP - The corresponding String parameter value is sent as an object of TIMESTAMP type to the database. The accepted format is YYYY-MM-DD HH:MM:SS[.FFF].

        • UUID - The corresponding String parameter value is sent as an object of UUID type to the database.

        Possible values include:
        • "JSON"
        • "UUID"
        • "TIMESTAMP"
        • "DATE"
        • "TIME"
        • "DECIMAL"
    • transactionId — (String)

      The identifier of a transaction that was started by using the BeginTransaction operation. Specify the transaction ID of the transaction that you want to include the SQL statement in.

      If the SQL statement is not part of a transaction, don't set this parameter.

    • includeResultMetadata — (Boolean)

      A value that indicates whether to include metadata in the results.

    • continueAfterTimeout — (Boolean)

      A value that indicates whether to continue running the statement after the call times out. By default, the statement stops running when the call times out.

      Note: For DDL statements, we recommend continuing to run the statement after the call times out. When a DDL statement terminates before it is finished running, it can result in errors and possibly corrupted data structures.
    • resultSetOptions — (map)

      Options that control how the result set is returned.

      • decimalReturnType — (String)

        A value that indicates how a field of DECIMAL type is represented in the response. The value of STRING, the default, specifies that it is converted to a String value. The value of DOUBLE_OR_LONG specifies that it is converted to a Long value if its scale is 0, or to a Double value otherwise.

        Note: Conversion to Double or Long can result in roundoff errors due to precision loss. We recommend converting to String, especially when working with currency values.
        Possible values include:
        • "STRING"
        • "DOUBLE_OR_LONG"
      • longReturnType — (String)

        A value that indicates how a field of LONG type is represented. Allowed values are LONG and STRING. The default is LONG. Specify STRING if the length or precision of numeric values might cause truncation or rounding errors.

        Possible values include:
        • "STRING"
        • "LONG"
    • formatRecordsAs — (String)

      A value that indicates whether to format the result set as a single JSON string. This parameter only applies to SELECT statements and is ignored for other types of statements. Allowed values are NONE and JSON. The default value is NONE. The result is returned in the formattedRecords field.

      For usage information about the JSON format for result sets, see Using the Data API in the Amazon Aurora User Guide.

      Possible values include:
      • "NONE"
      • "JSON"

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:

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

        The records returned by the SQL statement. This field is blank if the formatRecordsAs parameter is set to JSON.

        • isNull — (Boolean)

          A NULL value.

        • booleanValue — (Boolean)

          A value of Boolean data type.

        • longValue — (Integer)

          A value of long data type.

        • doubleValue — (Float)

          A value of double data type.

        • stringValue — (String)

          A value of string data type.

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

          A value of BLOB data type.

        • arrayValue — (map)

          An array of values.

          • booleanValues — (Array<Boolean>)

            An array of Boolean values.

          • longValues — (Array<Integer>)

            An array of integers.

          • doubleValues — (Array<Float>)

            An array of floating-point numbers.

          • stringValues — (Array<String>)

            An array of strings.

          • arrayValues — (Array<map>)

            An array of arrays.

      • columnMetadata — (Array<map>)

        Metadata for the columns included in the results. This field is blank if the formatRecordsAs parameter is set to JSON.

        • name — (String)

          The name of the column.

        • type — (Integer)

          The type of the column.

        • typeName — (String)

          The database-specific data type of the column.

        • label — (String)

          The label for the column.

        • schemaName — (String)

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

        • tableName — (String)

          The name of the table that includes the column.

        • isAutoIncrement — (Boolean)

          A value that indicates whether the column increments automatically.

        • isSigned — (Boolean)

          A value that indicates whether an integer column is signed.

        • isCurrency — (Boolean)

          A value that indicates whether the column contains currency values.

        • isCaseSensitive — (Boolean)

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

        • 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.

        • arrayBaseColumnType — (Integer)

          The type of the column.

      • numberOfRecordsUpdated — (Integer)

        The number of records updated by the request.

      • generatedFields — (Array<map>)

        Values for fields generated during a DML request.

        Note: The generatedFields data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the RETURNING clause. For more information, see Returning Data From Modified Rows in the PostgreSQL documentation.
        • isNull — (Boolean)

          A NULL value.

        • booleanValue — (Boolean)

          A value of Boolean data type.

        • longValue — (Integer)

          A value of long data type.

        • doubleValue — (Float)

          A value of double data type.

        • stringValue — (String)

          A value of string data type.

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

          A value of BLOB data type.

        • arrayValue — (map)

          An array of values.

          • booleanValues — (Array<Boolean>)

            An array of Boolean values.

          • longValues — (Array<Integer>)

            An array of integers.

          • doubleValues — (Array<Float>)

            An array of floating-point numbers.

          • stringValues — (Array<String>)

            An array of strings.

          • arrayValues — (Array<map>)

            An array of arrays.

      • formattedRecords — (String)

        A string value that represents the result set of a SELECT statement in JSON format. This value is only present when the formatRecordsAs parameter is set to JSON.

        The size limit for this field is currently 10 MB. If the JSON-formatted string representing the result set requires more than 10 MB, the call returns an error.

Returns:

  • (AWS.Request)

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

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

Performs a rollback of a transaction. Rolling back a transaction cancels its changes.

Service Reference:

Examples:

Calling the rollbackTransaction operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  secretArn: 'STRING_VALUE', /* required */
  transactionId: 'STRING_VALUE' /* required */
};
rdsdataservice.rollbackTransaction(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: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

    • secretArn — (String)

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

    • transactionId — (String)

      The identifier of the transaction to roll back.

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:

      • transactionStatus — (String)

        The status of the rollback operation.

Returns:

  • (AWS.Request)

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