{"id":13513790,"url":"https://github.com/customink/mysql2-lambda","last_synced_at":"2025-03-31T02:32:56.269Z","repository":{"id":54395702,"uuid":"277335862","full_name":"customink/mysql2-lambda","owner":"customink","description":"Precompiled Mysql2 Gem for AWS Lambda","archived":true,"fork":false,"pushed_at":"2022-12-06T13:18:34.000Z","size":16,"stargazers_count":23,"open_issues_count":0,"forks_count":6,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-09-02T02:36:52.895Z","etag":null,"topics":["aws","aws-lambda","fullstack-serverless","mysql","mysql2","rds","rds-proxy","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://lamby.custominktech.com","language":"Dockerfile","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":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-05T16:00:36.000Z","updated_at":"2024-02-23T02:19:03.000Z","dependencies_parsed_at":"2023-01-24T01:45:16.024Z","dependency_job_id":null,"html_url":"https://github.com/customink/mysql2-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Fmysql2-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Fmysql2-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Fmysql2-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customink%2Fmysql2-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/customink","download_url":"https://codeload.github.com/customink/mysql2-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222615149,"owners_count":17012022,"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":["aws","aws-lambda","fullstack-serverless","mysql","mysql2","rds","rds-proxy","ruby-on-rails"],"created_at":"2024-08-01T05:00:37.729Z","updated_at":"2024-11-01T17:30:42.639Z","avatar_url":"https://github.com/customink.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"⚠️ Given Lambda Containers are a thing now... and coupled with the fact that there are no AWS provided Amazon Linux 2 / Lambda containers higher than Ruby 2.7, I'd like to consider this project deprecated in favor of using custom images with the RIC installed. This is really easy to do and I outlined it here for those curious. https://github.com/customink/lamby-cookiecutter/pull/21\n\n\n[![Test](https://github.com/customink/mysql2-lambda/actions/workflows/test.yml/badge.svg)](https://github.com/customink/mysql2-lambda/actions/workflows/test.yml)\n\n# Mysql2 Lambda Gem\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\u003eVery simple [Mysql2](https://github.com/brianmario/mysql2) gem precompiled for Amazon Linux 1 \u0026 2 (Ruby 2.5 \u0026 2.7) with statically linked `libmysqlclient` ready for any AWS Lambda usage, including Rails. Add it to your Gemfile:\n\n\n```ruby\n# When using Rails.\ngem 'mysql2-lambda'\n\n# When NOT using Rails.\ngem 'mysql2-lambda', require: 'mysql2'\n```\n\nPart of a suite of open source projects from **[Lamby: Simple Rails \u0026 AWS Lambda Integration using Rack.](https://github.com/customink/lamby)** Details include:\n\n- Tested on Ruby 2.5.x \u0026 2.7.x\n- Small Size! Only 5 Megabytes. No Lambda Layers needed!\n- Works with any MySQL connection. Including RDS Proxy.\n\n## Methodology\n\nWe used the `amazon/aws-sam-cli-build-image-ruby2.5` Docker image from the [SAM CLI](https://github.com/aws/aws-sam-cli) project to build the MySQL Connector/C's `libmysqlclient`. From there we ensure the Mysql2 gem statically includes that library. The resulting packaged gem and `mysql2.so` file looks something like this.\n\n```shell\n$ ldd mysql2.so\n  linux-vdso.so.1 =\u003e  (0x00007ffcb15d4000)\n  libstdc++.so.6 =\u003e /usr/lib64/libstdc++.so.6 (0x00007fa8ebd21000)\n  librt.so.1 =\u003e /lib64/librt.so.1 (0x00007fa8ebb19000)\n  libpthread.so.0 =\u003e /lib64/libpthread.so.0 (0x00007fa8eb8fd000)\n  libgmp.so.10 =\u003e /usr/lib64/libgmp.so.10 (0x00007fa8eb687000)\n  libdl.so.2 =\u003e /lib64/libdl.so.2 (0x00007fa8eb483000)\n  libcrypt.so.1 =\u003e /lib64/libcrypt.so.1 (0x00007fa8eb24c000)\n  libm.so.6 =\u003e /lib64/libm.so.6 (0x00007fa8eaf4a000)\n  libc.so.6 =\u003e /lib64/libc.so.6 (0x00007fa8eab7c000)\n  libgcc_s.so.1 =\u003e /lib64/libgcc_s.so.1 (0x00007fa8ea966000)\n  /lib64/ld-linux-x86-64.so.2 (0x00007fa8ec72e000)\n  libfreebl3.so =\u003e /lib64/libfreebl3.so (0x00007fa8ea764000)\n```\n\n## Development\n\nClone or fork this repository, make sure you have Docker installed, then run the following commands.\n\n```shell\n./bin/setup\n./bin/build\n```\n\nYou will now have a packaged gem in the root of your project. Simple tests to make sure it works.\n\n```shell\n./bin/test 2.5\n./bin/test 2.7\n```\n\n## License\n\nThanks to all the contributors of the `Mysql2` (https://github.com/brianmario/mysql2) gem. The license here is the same as that. MIT.\n\n## Code of Conduct\n\nEveryone interacting in the Mysql2 Lambda project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/mysql2-lambda/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomink%2Fmysql2-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustomink%2Fmysql2-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomink%2Fmysql2-lambda/lists"}