Skip to content

Commit 7b153b7

Browse files
docs: add instructions to run code samples
1 parent 80e80f9 commit 7b153b7

File tree

2 files changed

+35
-14
lines changed

2 files changed

+35
-14
lines changed

docs/Documentation.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@
1818
- [Aurora Connection Tracker Plugin](./using-the-nodejs-wrapper/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md)
1919
- [Host Availability Strategy](./using-the-nodejs-wrapper/HostAvailabilityStrategy.md)
2020
- [Reader Selection Strategies](./using-the-nodejs-wrapper/ReaderSelectionStrategies.md)
21-
- [Development Guide](../docs/development-guide/DevelopmentGuide.md)
22-
- [Setup](../docs/development-guide/DevelopmentGuide.md#setup)
23-
- [Setting Up the AWS Advanced NodeJS Wrapper](../docs/development-guide/DevelopmentGuide.md#setting-up-the-aws-advanced-nodejs-wrapper)
24-
- [Testing Overview](../docs/development-guide/DevelopmentGuide.md#testing-overview)
25-
- [Performance Tests](../docs/development-guide/DevelopmentGuide.md#performance-tests)
26-
- [Running the Tests](../docs/development-guide/DevelopmentGuide.md#running-the-tests)
27-
- [Architecture](../docs/development-guide/Architecture.md)
28-
- [Plugin Manager](../docs/development-guide/PluginManager.md)
29-
- [Loadable Plugins](../docs/development-guide/LoadablePlugins.md)
30-
- [Plugin Pipeline Performance Results](../docs/development-guide/PluginPipelinePerformanceResults.md)
31-
- [Plugin Service](../docs/development-guide/PluginService.md)
32-
- [Pipelines](../docs/development-guide/Pipelines.md)
33-
- [Read-Write Splitting Plugin Performance Results](../docs/development-guide/ReadWriteSplittingPerformanceResults.md)
34-
- [Using The NodeJS Wrapper with Prisma ORM](./../examples/prisma_example/README.md)
21+
- [Development Guide](../docs/development-guide/DevelopmentGuide.md)
22+
- [Setup](../docs/development-guide/DevelopmentGuide.md#setup)
23+
- [Setting Up the AWS Advanced NodeJS Wrapper](../docs/development-guide/DevelopmentGuide.md#setting-up-the-aws-advanced-nodejs-wrapper)
24+
- [Testing Overview](../docs/development-guide/DevelopmentGuide.md#testing-overview)
25+
- [Performance Tests](../docs/development-guide/DevelopmentGuide.md#performance-tests)
26+
- [Running the Tests](../docs/development-guide/DevelopmentGuide.md#running-the-tests)
27+
- [Architecture](../docs/development-guide/Architecture.md)
28+
- [Plugin Manager](../docs/development-guide/PluginManager.md)
29+
- [Loadable Plugins](../docs/development-guide/LoadablePlugins.md)
30+
- [Plugin Pipeline Performance Results](../docs/development-guide/PluginPipelinePerformanceResults.md)
31+
- [Plugin Service](../docs/development-guide/PluginService.md)
32+
- [Pipelines](../docs/development-guide/Pipelines.md)
33+
- [Read-Write Splitting Plugin Performance Results](../docs/development-guide/ReadWriteSplittingPerformanceResults.md)
34+
- [Using The NodeJS Wrapper with Prisma ORM](./../examples/prisma_example/README.md)
35+
- [Running the AWS Advanced NodeJS Wrapper Code Samples](./../examples/aws_driver_example/README.md)

examples/aws_driver_example/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Running The AWS Advanced NodeJS Wrapper Code Samples
2+
3+
### Prerequisites
4+
5+
- [npm](https://www.npmjs.com/) 9.2.0+
6+
7+
### Running a Sample
8+
9+
Each code snippet in the `/examples/aws_driver_example` can be run from within the project. Each example requires existing databases or AWS resources, and will need the user to edit any credentials or user specific information for the sample to run correctly.
10+
11+
Prior to running a sample, all prerequisites for the sample must be met. For example, to run the `aws_iam_authentication_mysql_example.ts` file, you must have an IAM user set up and IAM Authentication must be enabled on the database you specify. See the individual [plugin pages](/docs/using-the-nodejs-wrapper/UsingTheNodejsWrapper.md#list-of-available-plugins) for more information.
12+
13+
Note than for any failover examples, failover will not be triggered. For example, the `aws_failover_mysql_example.ts` sample demonstrates enabling the failover plugin and failover handling, but will not initiate cluster failover on its own.
14+
15+
To run the sample:
16+
17+
1. Ensure all prerequisites have been met.
18+
2. Install all required packages with `npm install`.
19+
3. Navigate to the `/examples/aws_driver_example` directory.
20+
4. Run the command `npx tsx <filename>`. For example, to run the `aws_iam_authentication_mysql_example.ts` file, the command would be `npx tsx aws_iam_authentication_mysql_example.ts`.

0 commit comments

Comments
 (0)