Skip to content

Commit 4071f77

Browse files
committed
chore: standardize pg client naming on Pg casing with deprecated aliase
1 parent 3bc2bc6 commit 4071f77

39 files changed

Lines changed: 182 additions & 107 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200).
66

7+
## [Unreleased]
8+
9+
### :crab: Changed
10+
11+
- Renamed the PostgreSQL client to `AwsPgClient` and its pooled connection type to `AwsPgPooledConnection` for consistent `Pg` casing across the `pg` module. This is a non-breaking change.
12+
13+
### :warning: Deprecated
14+
15+
- `AwsPGClient` and `AwsPGPooledConnection` are now deprecated. They remain exported as backwards-compatible aliases of `AwsPgClient` and `AwsPgPooledConnection` and behave identically, so existing code continues to work without modification. Update imports to the new names; the deprecated aliases are scheduled for removal in the next major release.
16+
717
## [2.1.1] - 2026-05-28
818

919
### :magic_wand: Added

docs/using-the-nodejs-wrapper/ConfigurationPresets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A Configuration Preset is a [configuration profile](./UsingTheNodejsWrapper.md#c
1212
The Configuration Preset name should be specified with the [`profileName`](./UsingTheNodejsWrapper.md#connection-plugin-manager-parameters) parameter.
1313

1414
```typescript
15-
const client = new AwsPGClient({
15+
const client = new AwsPgClient({
1616
...
1717
profileName: "A2"
1818
});
@@ -30,7 +30,7 @@ ConfigurationProfileBuilder.get()
3030
.withDatabaseDialect(new CustomDatabaseDialect())
3131
.buildAndSet();
3232

33-
const client = new AwsPGClient({
33+
const client = new AwsPgClient({
3434
...
3535
profileName: "myNewProfile"
3636
});

docs/using-the-nodejs-wrapper/DatabaseDialects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Once the custom dialect class has been created, tell the AWS Advanced NodeJS Wra
5151
```typescript
5252
myDialect: DatabaseDialect = new CustomDialect();
5353

54-
const client = new AwsPGClient({
54+
const client = new AwsPgClient({
5555
...
5656
customDatabaseDialect: myDialect
5757
...

docs/using-the-nodejs-wrapper/UsingTheAwsClients.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ connection.query("SELECT NOW()", (error, results, fields) => {
2323
**Node-Postgres callback API (not supported):**
2424

2525
```typescript
26-
// ❌ This will NOT work with AwsPGClient
26+
// ❌ This will NOT work with AwsPgClient
2727
import { Client } from "pg";
2828

2929
const client = new Client({
@@ -190,6 +190,12 @@ console.log(rows[0].status); // "active"
190190

191191
## Node-Postgres Migration Guide
192192

193+
> [!NOTE]\
194+
> The PostgreSQL client and its pooled connection type were renamed to `AwsPgClient` and `AwsPgPooledConnection` for
195+
> consistent casing. The previous names `AwsPGClient` and `AwsPGPooledConnection` are still exported as **deprecated
196+
> aliases** that behave identically, so existing code continues to work without changes. Prefer `AwsPgClient` in new
197+
> code; the deprecated aliases are scheduled for removal in the next major release.
198+
193199
### Creating a Client
194200

195201
**node-postgres:**
@@ -208,12 +214,12 @@ const client = new Client({
208214
await client.connect();
209215
```
210216

211-
**AwsPGClient:**
217+
**AwsPgClient:**
212218

213219
```typescript
214-
import { AwsPGClient } from "aws-advanced-nodejs-wrapper/pg";
220+
import { AwsPgClient } from "aws-advanced-nodejs-wrapper/pg";
215221

216-
const client = new AwsPGClient({
222+
const client = new AwsPgClient({
217223
host: "cluster-endpoint",
218224
user: "database-user",
219225
password: "database-pwd",
@@ -235,7 +241,7 @@ const result = await client.query("SELECT NOW()");
235241
console.log(result.rows[0]); // { now: 2023-12-01T10:30:00.000Z }
236242
```
237243

238-
**AwsPGClient:**
244+
**AwsPgClient:**
239245

240246
```typescript
241247
const result = await client.query("SELECT NOW()");
@@ -251,7 +257,7 @@ const result = await client.query("SELECT $1::text as name, $2::int as age", ["J
251257
console.log(result.rows[0]); // { name: 'John', age: 25 }
252258
```
253259

254-
**AwsPGClient:**
260+
**AwsPgClient:**
255261

256262
```typescript
257263
const result = await client.query("SELECT $1::text as name, $2::int as age", ["John", 25]);
@@ -270,7 +276,7 @@ const result = await client.query({
270276
console.log(result.rows[0]); // { name: 'Jane', age: 30 }
271277
```
272278

273-
**AwsPGClient:**
279+
**AwsPgClient:**
274280

275281
```typescript
276282
const result = await client.query({
@@ -293,7 +299,7 @@ const result = await client.query({
293299
console.log(result[0]); // [1, 'active']
294300
```
295301

296-
**AwsPGClient:**
302+
**AwsPgClient:**
297303

298304
```typescript
299305
const result = await client.query({
@@ -317,7 +323,7 @@ const result = await client.query({
317323
console.log(result.rows[0]); // { id: 1, name: 'test' }
318324
```
319325

320-
**AwsPGClient:**
326+
**AwsPgClient:**
321327

322328
```typescript
323329
const result = await client.query({

docs/using-the-nodejs-wrapper/UsingTheNodejsWrapper.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ These parameters are applicable to any instance of the AWS Advanced NodeJS Wrapp
5353
| `resetSessionStateOnClose` | `boolean` | No | Enables resetting the session state before closing connection. | `true` | `latest` |
5454
| `enableGreenHostReplacement` | `boolean` | No | Enables replacing a green node host name with the original host name when the green host DNS doesn't exist anymore after a blue/green switchover. Refer to [Overview of Amazon RDS Blue/Green Deployments](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments-overview.html) for more details about green and blue nodes. | `false` | `latest` |
5555
| `clusterInstanceHostPattern` | `string` | If connecting using an IP address or custom domain URL: Yes<br><br>Otherwise: No | This parameter is not required unless connecting to an AWS RDS cluster via an IP address or custom domain URL. In those cases, this parameter specifies the cluster instance DNS pattern that will be used to build a complete instance endpoint. A "?" character in this pattern should be used as a placeholder for the DB instance identifiers of the instances in the cluster. See [here](#host-pattern) for more information. <br/><br/>Example: `?.my-domain.com`, `any-subdomain.?.my-domain.com`<br/><br/>Use case Example: If your cluster instance endpoints follow this pattern:`instanceIdentifier1.customHost`, `instanceIdentifier2.customHost`, etc. and you want your initial connection to be to `customHost:1234`, then your client configuration should look like this: `{ host: "customHost", port: 1234, database: "test", clusterInstanceHostPattern: "?.customHost" }` | If the provided host is not an IP address or custom domain, the NodeJS Wrapper will automatically acquire the cluster instance host pattern from the customer-provided host. | `latest` |
56-
| ~~`mysqlQueryTimeout`~~ | `number` | No | This parameter has been deprecated since version 1.1.0, applications should use the `wrapperQueryTimeout` parameter instead. <br/><br/> Query timeout in milliseconds. This is only applicable when using the AwsMySQLClient. To set query timeout for the AwsPGClient, please use the built-in `query_timeout` parameter. See the `node-postgres` [documentation](https://node-postgres.com/apis/client) for more details. | 20000 | `1.0.0` |
56+
| ~~`mysqlQueryTimeout`~~ | `number` | No | This parameter has been deprecated since version 1.1.0, applications should use the `wrapperQueryTimeout` parameter instead. <br/><br/> Query timeout in milliseconds. This is only applicable when using the AwsMySQLClient. To set query timeout for the AwsPgClient, please use the built-in `query_timeout` parameter. See the `node-postgres` [documentation](https://node-postgres.com/apis/client) for more details. | 20000 | `1.0.0` |
5757
| `wrapperConnectTimeout` | `number` | No | Connect timeout in milliseconds. This parameter will apply the provided timeout value to the underlying driver's built-in connect timeout parameter, if there is one available. | 20000 | `latest` |
5858
| `wrapperQueryTimeout` | `number` | No | Query timeout in milliseconds. This parameter will apply the provided timeout value to the underlying driver's built-in query timeout parameter, if there is one available. The wrapper will also use this value for its own query timeout implementation. | 20000 | `latest` |
5959
| `wrapperKeepAliveProperties` | `Map<string, any>` | No | If the underlying target driver has keepAlive properties available, properties within this map will be applied to the underlying target driver's client configuration. For example, the node-postgres driver's `keepAlive` and `keepAliveInitialDelayMillis` properties can be configured by setting this property in the client configuration: `{ wrapperKeepAliveProperties: new Map<string, any>([["keepAlive", true], ["keepAliveInitialDelayMillis", 1234]]) }`. <br/><br/> Currently supported drivers: node-postgres | `null` |
@@ -167,7 +167,7 @@ ConfigurationProfileBuilder.get()
167167
.buildAndSet();
168168

169169
// Use the configuration profile "testProfile"
170-
const client = new AwsPGClient({
170+
const client = new AwsPgClient({
171171
user: "user",
172172
password: "password",
173173
host: "host",

docs/using-the-nodejs-wrapper/custom-configuration/AwsCredentialsConfiguration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class MyCustomAwsCredentialProvider implements AwsCredentialsProviderHandler {
1818
}
1919
myProvider: MyCustomAwsCredentialProvider = new MyCustomAwsCredentialProvider();
2020

21-
const client = new AwsPGClient({
21+
const client = new AwsPgClient({
2222
...
2323
customAwsCredentialProviderHandler: myProvider
2424
...

docs/using-the-nodejs-wrapper/using-plugins/UsingTheAuroraInitialConnectionStrategyPlugin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ await client.connect();
3737

3838
// If using PostgreSQL:
3939

40-
const client = new AwsPGClient(params);
40+
const client = new AwsPgClient(params);
4141
await client.connect();
4242
```
4343

@@ -56,6 +56,6 @@ await client.connect();
5656

5757
// If using PostgreSQL:
5858

59-
const client = new AwsPGClient(params);
59+
const client = new AwsPgClient(params);
6060
await client.connect();
6161
```

docs/using-the-nodejs-wrapper/using-plugins/UsingTheBlueGreenPlugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ params = {
8686
blue_green_monitoring_wrapperConnectTimeout: 10000
8787
};
8888
89-
const client = new AwsPGClient(params);
89+
const client = new AwsPgClient(params);
9090
await client.connect();
9191
```
9292

docs/using-the-nodejs-wrapper/using-plugins/UsingTheDeveloperPlugin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ params = {
2222
plugins: "dev"
2323
};
2424

25-
const client = new AwsPGClient(params);
25+
const client = new AwsPgClient(params);
2626

2727
const testErrorToRaise: Error = new Error("test");
2828
ErrorSimulatorManager.raiseErrorOnNextConnect(testErrorToRaise);
@@ -43,7 +43,7 @@ params = {
4343
plugins: "dev"
4444
};
4545

46-
const client = new AwsPGClient(params);
46+
const client = new AwsPgClient(params);
4747
await client.connect();
4848

4949
const simulator: ErrorSimulator = client.getPluginInstance<ErrorSimulator>(DeveloperConnectionPlugin);

docs/using-the-nodejs-wrapper/using-plugins/UsingTheFastestResponseStrategyPlugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const client = new AwsMySQLClient(params);
2323
await client.connect();
2424

2525
// If using Postgres:
26-
const client = new AwsPGClient(params);
26+
const client = new AwsPgClient(params);
2727
await client.connect();
2828
```
2929

0 commit comments

Comments
 (0)