From dda397767923119df5f4cc087849c9075a9719c5 Mon Sep 17 00:00:00 2001 From: Sophia Chu <112967780+sophia-bq@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:23:55 -0800 Subject: [PATCH] docs: driver dialect (#351) --- docs/using-the-nodejs-wrapper/DatabaseDialects.md | 4 ++-- docs/using-the-nodejs-wrapper/DriverDialects.md | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docs/using-the-nodejs-wrapper/DriverDialects.md diff --git a/docs/using-the-nodejs-wrapper/DatabaseDialects.md b/docs/using-the-nodejs-wrapper/DatabaseDialects.md index 683e8369..04aa92f5 100644 --- a/docs/using-the-nodejs-wrapper/DatabaseDialects.md +++ b/docs/using-the-nodejs-wrapper/DatabaseDialects.md @@ -1,8 +1,8 @@ # Database Dialects -## What are database dialects? +## What are Database Dialects? -The AWS Advanced NodeJS Wrapper is a wrapper that requires an underlying driver, and it is meant to be compatible with any NodeJS driver. Database dialects help the AWS Advanced NodeJS Wrapper determine what kind of underlying database is being used. To function correctly, the AWS Advanced NodeJS Wrapper requires details unique to specific databases such as the default port number or the method to get the current host from the database. These details can be defined and provided to the AWS Advanced NodeJS Wrapper by using database dialects. +The AWS Advanced NodeJS Wrapper is a wrapper that requires an underlying driver. It is currently compatible with [pg](https://github.com/brianc/node-postgres) and [mysql2](https://github.com/sidorares/node-mysql2). Database dialects help the AWS Advanced NodeJS Wrapper determine what kind of underlying database is being used. To function correctly, the AWS Advanced NodeJS Wrapper requires details unique to specific databases such as the default port number or the method to get the current host from the database. These details can be defined and provided to the AWS Advanced NodeJS Wrapper by using database dialects. ## Configuration Parameters diff --git a/docs/using-the-nodejs-wrapper/DriverDialects.md b/docs/using-the-nodejs-wrapper/DriverDialects.md new file mode 100644 index 00000000..933354e9 --- /dev/null +++ b/docs/using-the-nodejs-wrapper/DriverDialects.md @@ -0,0 +1,14 @@ +# Driver Dialects + +## What are Driver Dialects? + +The AWS Advanced NodeJS Wrapper is a wrapper that requires an underlying driver. It is currently compatible with [pg](https://github.com/brianc/node-postgres) and [mysql2](https://github.com/sidorares/node-mysql2). Driver dialects help the AWS Advanced NodeJS Wrapper to properly pass calls to a target driver. To function correctly, the AWS Advanced NodeJS Wrapper requires details unique to the specific target driver such as the method to create the current connection, whether to include some specific connection parameters, etc. These details can be defined and provided to the AWS Advanced NodeJS Wrapper by using driver dialects. + +To get a connection with the AWS Advanced NodeJS Wrapper, the user application can create a client object and connect. The database type being connected to determines the client and the driver dialect. + +### List of Available Driver Dialects + +| Database Type | Client | Driver Dialect | Underlying Node Driver | +| ------------- | ---------------- | --------------------------- | -------------------------------------------------------- | +| MySQL | `AwsMySQLClient` | `MySQL2DriverDialect` | [node-mysql2](https://github.com/sidorares/node-mysql2) | +| PostgreSQL | `AwsPgClient` | `NodePostgresDriverDialect` | [node-postgres](https://github.com/brianc/node-postgres) |