diff --git a/README.md b/README.md index 4054442..6a3e176 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ Below is a table containing all of the possible configuration options for the `d | resourceArn | `string` | The ARN of your Aurora Serverless Cluster. This value is *required*, but can be overridden when querying. | | | secretArn | `string` | The ARN of the secret associated with your database credentials. This is *required*, but can be overridden when querying. | | | database | `string` | *Optional* default database to use with queries. Can be overridden when querying. | | +| engine | `mysql` or `pg` | The type of database engine you're connecting to (MySQL or Postgres). | `mysql` | | hydrateColumnNames | `boolean` | When `true`, results will be returned as objects with column names as keys. If `false`, results will be returned as an array of values. | `true` | | ~~keepAlive~~ (deprecated) | `boolean` | See [Connection Reuse](#connection-reuse) below. | | | ~~sslEnabled~~ (deprecated) | `boolean` | Set this in the `options` | `true` | diff --git a/index.js b/index.js index 5fe7b9a..1e12a2c 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ * https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html * * @author Jeremy Daly - * @version 1.1.0 + * @version 1.2.0 * @license MIT */ @@ -490,7 +490,7 @@ const commit = async (config,queries,rollback) => { /** * Create a Data API client instance * @param {object} params - * @param {'mysql'|'pg'} params.engine The type of database (MySQL or Postgres) + * @param {'mysql'|'pg'} [params.engine=mysql] The type of database (MySQL or Postgres) * @param {string} params.resourceArn The ARN of your Aurora Serverless Cluster * @param {string} params.secretArn The ARN of the secret associated with your * database credentials @@ -529,7 +529,7 @@ const init = params => { // Require engine engine: typeof params.engine === 'string' ? params.engine - : error('\'engine\' string value required'), + : 'mysql', // Require secretArn secretArn: typeof params.secretArn === 'string' ? diff --git a/package-lock.json b/package-lock.json index 01f9eaf..d76d786 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1048,8 +1048,7 @@ }, "acorn": { "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "resolved": "", "dev": true }, "acorn-globals": { @@ -1210,9 +1209,9 @@ "dev": true }, "aws-sdk": { - "version": "2.713.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.713.0.tgz", - "integrity": "sha512-axR1eOVn134KXJc1IT+Au2TXcK6oswY+4nvGe5GfU3pXeehhe0xNeP9Bw9yF36TRBxuvu4IJ2hRHDKma05smgA==", + "version": "2.811.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.811.0.tgz", + "integrity": "sha512-Tbz31UUYj9MEDWKDEmK1Ppc6iFbZhaHjAkjA4CqEQQ6YE8309H+PhOXbcdzjMC1lDek32eItLvMGulPuhj2MyQ==", "dev": true, "requires": { "buffer": "4.9.2", @@ -1486,9 +1485,9 @@ } }, "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true }, "bcrypt-pbkdf": { @@ -4803,9 +4802,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash.sortby": { @@ -4948,20 +4947,12 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "ms": { @@ -6544,9 +6535,9 @@ "dev": true }, "sqlstring": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", - "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.2.tgz", + "integrity": "sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg==" }, "sshpk": { "version": "1.16.1", diff --git a/package.json b/package.json index 8b2eff4..67544d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-api-client", - "version": "1.1.0", + "version": "1.2.0", "description": "A lightweight wrapper that simplifies working with the Amazon Aurora Serverless Data API", "main": "index.js", "scripts": { @@ -25,17 +25,15 @@ }, "homepage": "https://github.com/jeremydaly/data-api-client#readme", "devDependencies": { - "aws-sdk": "^2.713.0", + "aws-sdk": "^2.811.0", "eslint": "^6.8.0", "jest": "^25.5.4", "rewire": "^4.0.1" }, "dependencies": { - "sqlstring": "^2.3.1" + "sqlstring": "^2.3.2" }, "files": [ - "LICENSE", - "README.md", "index.js" ] }