Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add instructions to run code samples #374

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crystall-bitquill
Copy link
Contributor

Summary

Description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@crystall-bitquill crystall-bitquill added the ready for review Pull requests that are ready to be reviewed label Jan 17, 2025

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Note that 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also provide information on how to initiate cluster failover

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I am good with this for now as a first draft

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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.
4. Edit any credentials or user specific information in the desired file. For example, set the client properties in the file to match an existing database for the queries to run against.
5. 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`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a thought since editing isn't explicitly in the prerequisites section.

- [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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on putting this above the Development Guide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Pull requests that are ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants