Skip to content

Commit

Permalink
docs: add instructions to run code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
crystall-bitquill committed Jan 17, 2025
1 parent 80e80f9 commit 7b153b7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
29 changes: 15 additions & 14 deletions docs/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
- [Aurora Connection Tracker Plugin](./using-the-nodejs-wrapper/using-plugins/UsingTheAuroraConnectionTrackerPlugin.md)
- [Host Availability Strategy](./using-the-nodejs-wrapper/HostAvailabilityStrategy.md)
- [Reader Selection Strategies](./using-the-nodejs-wrapper/ReaderSelectionStrategies.md)
- [Development Guide](../docs/development-guide/DevelopmentGuide.md)
- [Setup](../docs/development-guide/DevelopmentGuide.md#setup)
- [Setting Up the AWS Advanced NodeJS Wrapper](../docs/development-guide/DevelopmentGuide.md#setting-up-the-aws-advanced-nodejs-wrapper)
- [Testing Overview](../docs/development-guide/DevelopmentGuide.md#testing-overview)
- [Performance Tests](../docs/development-guide/DevelopmentGuide.md#performance-tests)
- [Running the Tests](../docs/development-guide/DevelopmentGuide.md#running-the-tests)
- [Architecture](../docs/development-guide/Architecture.md)
- [Plugin Manager](../docs/development-guide/PluginManager.md)
- [Loadable Plugins](../docs/development-guide/LoadablePlugins.md)
- [Plugin Pipeline Performance Results](../docs/development-guide/PluginPipelinePerformanceResults.md)
- [Plugin Service](../docs/development-guide/PluginService.md)
- [Pipelines](../docs/development-guide/Pipelines.md)
- [Read-Write Splitting Plugin Performance Results](../docs/development-guide/ReadWriteSplittingPerformanceResults.md)
- [Using The NodeJS Wrapper with Prisma ORM](./../examples/prisma_example/README.md)
- [Development Guide](../docs/development-guide/DevelopmentGuide.md)
- [Setup](../docs/development-guide/DevelopmentGuide.md#setup)
- [Setting Up the AWS Advanced NodeJS Wrapper](../docs/development-guide/DevelopmentGuide.md#setting-up-the-aws-advanced-nodejs-wrapper)
- [Testing Overview](../docs/development-guide/DevelopmentGuide.md#testing-overview)
- [Performance Tests](../docs/development-guide/DevelopmentGuide.md#performance-tests)
- [Running the Tests](../docs/development-guide/DevelopmentGuide.md#running-the-tests)
- [Architecture](../docs/development-guide/Architecture.md)
- [Plugin Manager](../docs/development-guide/PluginManager.md)
- [Loadable Plugins](../docs/development-guide/LoadablePlugins.md)
- [Plugin Pipeline Performance Results](../docs/development-guide/PluginPipelinePerformanceResults.md)
- [Plugin Service](../docs/development-guide/PluginService.md)
- [Pipelines](../docs/development-guide/Pipelines.md)
- [Read-Write Splitting Plugin Performance Results](../docs/development-guide/ReadWriteSplittingPerformanceResults.md)
- [Using The NodeJS Wrapper with Prisma ORM](./../examples/prisma_example/README.md)
- [Running the AWS Advanced NodeJS Wrapper Code Samples](./../examples/aws_driver_example/README.md)
20 changes: 20 additions & 0 deletions examples/aws_driver_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Running The AWS Advanced NodeJS Wrapper Code Samples

### Prerequisites

- [npm](https://www.npmjs.com/) 9.2.0+

### Running a Sample

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.

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.

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.

To run the sample:

1. Ensure all prerequisites have been met.
2. Install all required packages with `npm install`.
3. Navigate to the `/examples/aws_driver_example` directory.
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 comments on commit 7b153b7

Please sign in to comment.