{"id":13879502,"url":"https://github.com/customink/activerecord-aurora-serverless-adapter","last_synced_at":"2025-07-16T15:32:32.640Z","repository":{"id":38294298,"uuid":"226399358","full_name":"customink/activerecord-aurora-serverless-adapter","owner":"customink","description":"ActiveRecord Adapter for Amazon Aurora Serverless","archived":true,"fork":false,"pushed_at":"2023-01-19T16:37:01.000Z","size":539,"stargazers_count":66,"open_issues_count":31,"forks_count":7,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-04-28T22:42:54.038Z","etag":null,"topics":["activerecord","activerecord-adapter","aurora","aws-lambda","fullstack-serverless","ruby-on-rails","serverless"],"latest_commit_sha":null,"homepage":"https://technology.customink.com/blog/2020/01/03/migrate-your-rails-app-from-heroku-to-aws-lambda/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/customink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-06T19:54:52.000Z","updated_at":"2024-01-16T14:31:55.000Z","dependencies_parsed_at":"2023-02-11T10:00:40.073Z","dependency_job_id":null,"html_url":"https://github.com/customink/activerecord-aurora-serverless-adapter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Factiverecord-aurora-serverless-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Factiverecord-aurora-serverless-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Factiverecord-aurora-serverless-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Factiverecord-aurora-serverless-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/customink","download_url":"https://codeload.github.com/customink/activerecord-aurora-serverless-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226143895,"owners_count":17580245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","activerecord-adapter","aurora","aws-lambda","fullstack-serverless","ruby-on-rails","serverless"],"created_at":"2024-08-06T08:02:23.103Z","updated_at":"2024-11-24T08:31:26.148Z","avatar_url":"https://github.com/customink.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\n# ActiveRecord Aurora Serverless Adapter\n\n\u003ca href=\"https://www.youtube.com/watch?v=Q0cqKl6ktIg\"\u003e\u003cimg alt=\"Aurora Serverless on Rails\" src=\"https://user-images.githubusercontent.com/2381/71551059-c507f180-29ab-11ea-91dc-0e83a0ed317f.png\"\u003e\u003c/a\u003e\n\n[![CI Status](https://github.com/customink/activerecord-aurora-serverless-adapter/workflows/CI/badge.svg)](https://github.com/customink/activerecord-aurora-serverless-adapter/actions)\n\n\u003ca href=\"https://github.com/customink/lamby\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/2381/59363668-89edeb80-8d03-11e9-9985-2ce14361b7e3.png\" alt=\"Lamby: Simple Rails \u0026 AWS Lambda Integration using Rack.\" align=\"right\" width=\"300\" /\u003e\u003c/a\u003e\n\nSimple ActiveRecord Mysql2 adapter extensions to allow Rails to use [AWS Aurora Serverless](https://aws.amazon.com/rds/aurora/serverless/) via the [Aws::RDSDataService::Client](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/RDSDataService/Client.html) interface. Perfect if you are using [Lamby](https://lamby.custominktech.com) to deploy your Rails applications to AWS Lambda.\n\n**[Lamby: Simple Rails \u0026 AWS Lambda Integration using Rack.](https://lamby.custominktech.com)**\n\n\n## Highlights\n\nThis gem allows Rails to seamless use\n\n* Tested on Rails v5.2 and v6.0.\n* No need for the `mysql2` gem at all!\n* Developed and tested with Aurora Serverless MySQL v5.6.\n* Emoji support via `utf8mb4`. Please configure your cluster's parameter group. See our [CDK Stack](/blob/master/test/aurora-serverless/lib/aurora-serverless-stack.ts) for examples.\n\nHere are some misc features that work differently for the Mysql2 adapter under Aurora Serverless.\n\n* Multiple schemas are not supported.\n* Prepared statements are not supported.\n* Batch statements are not supported.\n* Advisory locks are not supported.\n\n\n## Usage\n\nAdd the gem to your `Gemfile`. Remember, You **DO NOT** have to add the `mysql2` gem. This adapter will replace the MySQL connection with the `Aws::RDSDataService::Client` API calls.\n\n```ruby\ngem 'activerecord-aurora-serverless-adapter'\n```\n\nAssuming you have [created your database](/test/aurora-serverless/lib/aurora-serverless-stack.ts) with the Data API enabled and [configured your secrets](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html) then configure your `database.yml` file like so.\n\n```yaml\ndatabase: 'mydatabase'\nadapter: aurora_serverless\nsecret_arn: arn:aws:secretsmanager:us-east-1:123456789012:secret:Secret-kd2ASwipxeWw-Bdsiww\nresource_arn: arn:aws:rds:us-east-1:123456789012:cluster:mydatabase\n```\n\nlease feel free to use any valid ActiveRecord configuration in your database.yml file. We also allow all [Aws::RDSDataService::Client](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/RDSDataService/Client.html#initialize-instance_method) options here too! Any valid option will be passed to `Aws::RDSDataService::Client.new`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/customink/activerecord-aurora-serverless-adapter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n### Testing\n\nCloning the repo and running the tests locally is super easy assuming you have:\n\n1. Docker Installed\n2. AWS Account Configured\n\nThese commands will use Docker to setup a node runtime leveraging [AWD CDK](https://github.com/aws/aws-cdk) to deploy an Aurora Serverless stack. Note, you may be to use/set `AWS_PROFILE` for the deploy command.\n\n```s\n$ ./bin/bootstrap\n$ export AASA_MASTER_USER=admin\n$ export AASA_MASTER_PASS=supersecret\n$ ./test/bin/deploy-aurora\n```\n\nThe outputs of this deployed stack will contain an `AASASecretArn` and a `AASAAuroraClusterArn` value. Please place these into the local `.env` file in the following format where `{{ Value }}` is replaced.\n\n```\nAASA_SECRET_ARN={{ AASASecretArn }}\nAASA_RESOURCE_ARN2={{ AASAResourceArn }}\n\nAASA_SECRET_ARN={{ AASASecretArn2 }}\nAASA_RESOURCE_ARN_2={{ AASAResourceArn2 }}\n```\n\nFinally, assuming you have your default AWS account setup with full access to your account, now you can run the tests. The `AWS_PROFILE` can be used here and set in `.env` file as needed or you can use the `AASAUserAccessKeyId` and `AASAUserSecretAccessKey` outputs as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environments set in `.env` too.\n\n```s\n$ ./bin/test\n```\n\n#### Working With The CDK App/Stack\n\nTo work with the CDK project within the test directory, run the following commands.\n\n```s\n$ docker-compose \\\n  --project-name aasa \\\n  run \\\n  cdk \\\n  bash\n\n$ cd ./test/aurora-serverless\n```\n\nFrom here you can run `npm`, `tsc`, `cdk` or whatever commands are needed.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n\n## Code of Conduct\n\nEveryone interacting in the adapter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/activerecord-aurora-serverless-adapter/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomink%2Factiverecord-aurora-serverless-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustomink%2Factiverecord-aurora-serverless-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomink%2Factiverecord-aurora-serverless-adapter/lists"}