lesgo 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,10 @@ declare const _default: {
6
6
  proxy: {
7
7
  dbCredentialsSecretId: string | undefined;
8
8
  host: string | undefined;
9
+ port: string | undefined;
10
+ connectionLimit: number;
11
+ waitForConnections: boolean;
12
+ queueLimit: number;
9
13
  };
10
14
  };
11
15
  };
@@ -8,6 +8,16 @@ export default {
8
8
  dbCredentialsSecretId:
9
9
  process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_DB_CREDENTIALS_SECRET_ID,
10
10
  host: process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_HOST,
11
+ port: process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_PORT,
12
+ connectionLimit: Number(
13
+ process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_CONNECTION_LIMIT || '10'
14
+ ),
15
+ waitForConnections:
16
+ process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_WAIT_FOR_CONNECTIONS ===
17
+ 'true',
18
+ queueLimit: Number(
19
+ process.env.LESGO_AWS_RDS_AURORA_MYSQL_PROXY_QUEUE_LIMIT || '0'
20
+ ),
11
21
  },
12
22
  },
13
23
  },
@@ -64,26 +64,22 @@ const getMySQLProxyClient = (connOptions, clientOpts) =>
64
64
  singletonConn,
65
65
  }
66
66
  );
67
- const validatedDbCredentials = validateFields(dbCredentials, [
68
- { key: 'host', type: 'string', required: true },
69
- { key: 'username', type: 'string', required: true },
70
- { key: 'password', type: 'string', required: true },
71
- ]);
72
67
  const connOpts = Object.assign(
73
68
  {
74
- host: rdsConfig.aurora.mysql.proxy.host || validatedDbCredentials.host,
69
+ host: rdsConfig.aurora.mysql.proxy.host || dbCredentials.host,
75
70
  database: databaseName,
71
+ port: rdsConfig.aurora.mysql.proxy.port || dbCredentials.port || 3306,
72
+ connectionLimit: rdsConfig.aurora.mysql.proxy.connectionLimit || 10,
73
+ waitForConnections:
74
+ rdsConfig.aurora.mysql.proxy.waitForConnections || true,
75
+ queueLimit: rdsConfig.aurora.mysql.proxy.queueLimit || 0,
76
76
  },
77
77
  connOptions
78
78
  );
79
79
  logger.debug(`${FILE}::CONN_OPTS`, { connOpts });
80
80
  const dbPool = createPool(
81
81
  Object.assign(
82
- {
83
- user: validatedDbCredentials.username,
84
- password: validatedDbCredentials.password,
85
- connectionLimit: 20,
86
- },
82
+ { user: dbCredentials.username, password: dbCredentials.password },
87
83
  connOpts
88
84
  )
89
85
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lesgo",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "Core framework for lesgo node.js serverless framework.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",