
@aws-sdk/client-rds-data
AWS SDK for JavaScript Rds Data Client for Node.js, Browser and React Native
About
AWS SDK for JavaScript Rds Data Client for Node.js, Browser and React Native
Live mirror of the GitHub README. Updated whenever the repo's default branch changes.
@aws-sdk/client-rds-data
Description
AWS SDK for JavaScript RDSData Client for Node.js, Browser and React Native.
RDS Data API
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, provisioned, and Serverless v1
-
Aurora MySQL - Serverless v2, provisioned, and Serverless v1
For more information about the Data API, see Using RDS Data API in the Amazon Aurora User Guide.
Installing
To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-rds-datayarn add @aws-sdk/client-rds-datapnpm add @aws-sdk/client-rds-data
Getting Started
Import
The AWS SDK is modulized by clients and commands.
To send a request, you only need to import the RDSDataClient and
the commands you need, for example BeginTransactionCommand:
// ES5 example
const { RDSDataClient, BeginTransactionCommand } = require("@aws-sdk/client-rds-data");
// ES6+ example
import { RDSDataClient, BeginTransactionCommand } from "@aws-sdk/client-rds-data";
Usage
To send a request:
- Instantiate a client with configuration (e.g. credentials, region).
- See docs/CLIENTS for configuration details.
- See @aws-sdk/config for additional options.
- Instantiate a command with input parameters.
- Call the
sendoperation on the client, providing the command object as input.
const client = new RDSDataClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new BeginTransactionCommand(params);
Async/await
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
Promises
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
Aggregated client
The aggregated client class is exported from the same package, but without the "Client" suffix.
RDSData extends RDSDataClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (RDSDataClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { RDSData } from "@aws-sdk/client-rds-data";
const client = new RDSData({ region: "REGION" });
// async/await.
try {
const data = await client.beginTransaction(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.beginTransaction(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.beginTransaction(params, (err, data) => {
// process err and data.
});
Troubleshooting
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Getting Help
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
- Visit the Developer Guide or API Reference.
- Check out the blog posts tagged with
aws-sdk-json AWS Developer Blog. - Ask a question on StackOverflow and tag it with
aws-sdk-js. - Join the AWS JavaScript community on gitter.
- If it turns out that you may have found a bug, please open an issue.
To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
Contributing
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-rds-data package is updated.
To contribute to client you can check our generate clients scripts.
License
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Client Commands (Operations List)
BatchExecuteStatement
BeginTransaction
CommitTransaction
ExecuteSql
ExecuteStatement
RollbackTransaction
Quick facts
npm install @aws-sdk/client-rds-dataHow Sourcemap Explorer detects @aws-sdk/client-rds-data
We catch @aws-sdk/client-rds-data from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/@aws-sdk/client-rds-data/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.
- 1
Confirm the site exposes sourcemaps
In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment.
- 2
Find the package in the bundle
Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/@aws-sdk/client-rds-data/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/@aws-sdk/client-rds-data/package.json` gives you the exact installed version.
- 3
Read the version directly from package.json
Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/@aws-sdk/client-rds-data/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.
Recent versions
FAQ
What is @aws-sdk/client-rds-data used for?
AWS SDK for JavaScript Rds Data Client for Node.js, Browser and React Native
How can I tell if a website is using @aws-sdk/client-rds-data?
Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `@aws-sdk/client-rds-data` from two complementary signals: `node_modules/@aws-sdk/client-rds-data/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.
What is the latest version of @aws-sdk/client-rds-data?
3.1048.0, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.
Where can I read more?
Project homepage: https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-rds-data. Source code: https://github.com/aws/aws-sdk-js-v3. Published on npm: https://www.npmjs.com/package/@aws-sdk/client-rds-data. Licensed as Apache-2.0.
Detected by Sourcemap Explorer
When a bundle ships sourcemaps, we read the embedded package.json for @aws-sdk/client-rds-data and report the precise version. Without sourcemaps, an import / require in the page's scripts is enough to flag it.