Skip to content

Commit

Permalink
docs: driver dialect (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-bq authored Dec 20, 2024
1 parent bde5d18 commit dda3977
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/using-the-nodejs-wrapper/DatabaseDialects.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 14 additions & 0 deletions docs/using-the-nodejs-wrapper/DriverDialects.md
Original file line number Diff line number Diff line change
@@ -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) |

0 comments on commit dda3977

Please sign in to comment.