{"_id":"@apolofx/mysql-data-api","name":"@apolofx/mysql-data-api","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@apolofx/mysql-data-api","version":"0.1.1","main":"src/index.js","scripts":{"test":"eslint src/","fix":"eslint src/ --fix"},"keywords":[],"author":{"name":"Fyreware"},"license":"MIT","repository":{"type":"git"},"devDependencies":{"aws-sdk":"^2.540.0","eslint":"^6.6.0","eslint-config-airbnb-base":"^14.0.0","eslint-plugin-import":"^2.18.2"},"dependencies":{"@apolofx/data-api-client":"1.3.0","events":"^3.0.0","sqlstring":"^2.3.1"},"description":"[![CircleCI](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master.svg?style=svg)](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master)","_id":"@apolofx/mysql-data-api@0.1.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-wCmR/M6MPRJ6/YYcW8nHR7OKobODzqHDTFK8mkwWnyKR70gADXiQ+6uGbzBuW4ZXcbNMpM7hbDHjPUPdY9tkDg==","shasum":"11c6c553c47db866033fd1246f232b7addbf3822","tarball":"https://registry.npmjs.org/@apolofx/mysql-data-api/-/mysql-data-api-0.1.1.tgz","fileCount":4,"unpackedSize":7053,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkSHhIMv4LVAigMKWffkyTfWDhFEtQjiInOaXaWyyngAiB/hK1gCwGxZX4UsAGnWOGfJZaTKufvFjsN/f1KT3INVA=="}]},"_npmUser":{"name":"apolofx","email":"nacho.conso@gmail.com"},"directories":{},"maintainers":[{"name":"apolofx","email":"nacho.conso@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mysql-data-api_0.1.1_1702678103815_0.5187692603963305"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-15T22:08:23.690Z","0.1.1":"2023-12-15T22:08:24.061Z","modified":"2023-12-15T22:08:24.388Z"},"maintainers":[{"name":"apolofx","email":"nacho.conso@gmail.com"}],"description":"[![CircleCI](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master.svg?style=svg)](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master)","keywords":[],"repository":{"type":"git"},"author":{"name":"Fyreware"},"license":"MIT","readme":"# Mysql Data API Wapper\n[![CircleCI](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master.svg?style=svg)](https://circleci.com/gh/Fyreware/mysql-data-api/tree/master)\n\nThis package was created to easily enabled the sequelize package to utilize the AWS data-api for **Aurora Serverless MySQL** by mocking parts of the interface of the [mysql2](https://github.com/brianmario/mysql2) package that is utilize in sequelize mysql dialect.\n\n## Getting Started\nThis package has only been testes for sequelize v5, and only for the *mysql* dialect.\n\n### Prerequisites\nWhen getting started make sure you are using **Aurora Serverless MySQL** and that the **Data API** is enabled.\nAnd that you cluster is configured to use secrets from **AWS Secrets Manager**\n\nInstall sequelize in project\n```\nnpm i --save sequelize\n```\n\n### Installing\n\nInstall Wrapper\n\n```\nnpm install @fyreware/mysql-data-api --save\n```\n### Usage\nWhen using the data api wrapper you will configure sequelize like normal with the exception of of certain fields that are *ignored*, or have been *hijacked* by the wrapper as shown below.\n\n``` javascript\nconst database = 'testDb'\n// Arn of Aurora serverless cluster cluster\nconst host = 'arn:aws:rds:us-east-1:123456789000:cluster:http-endpoint-test';\n\n// This param is ignored by the wrapper.\nconst username = 'anything'; \n\n// Arn of secrets manager secret containing the rds credentials\nconst passowrd = 'arn:aws:secretsmanager:region:123456789012:secret:tutorials/MyFirstTutorialSecret-jiObOV'\n\nconst sequelize = new Sequelize(database, username, password, {\n  host: host,\n  dialect: 'mysql'\n\n  // This tells sequelize to load our module instead of the `mysql2` module\n  dialectModulePath: '@fyreware/mysql-data-api',\n});\n```\n\n### Things to know\n* When using the **Data API** is that you will not be able to insert or select *zero date values* on the database ass both will result in error. This is a limitation of the **Data API** its self so not much can be done about it. We suggest ensuring these values are not zero values by either explicitly setting the date on insert or setting a default value of *NULL* or *CURRENT_TIMESTAMP*.\n\n* Currently AWS credentials can only be passed in via the environment. So local development is only works when you use the **AWS Environment Variables** or have the default profile set in your **Shared Credentials File**\n\n## Running the tests\n\nExplain how to run the automated tests for this system\n\n\n### And coding style tests\n\n```\nnpm test\n```\n\n## Deployment\n\nAdd additional notes about how to deploy this on a live system\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). \n\n## Authors\n\n* **Michael Strong** - *Initial work* - [mtstrong17](https://github.com/mtstrong17)\n* **Travis Delly** - *Initial work* - [Dellybro](https://github.com/Dellybro)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","readmeFilename":"README.md"}