New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

postgresql-lambda

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postgresql-lambda

  • 1.3.4.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Test

Mysql2 Lambda Gem

Lamby: Simple Rails & AWS Lambda Integration using Rack.Very simple Mysql2 gem precompiled for Amazon Linux 1 & 2 (Ruby 2.5 & 2.7) with statically linked libmysqlclient ready for any AWS Lambda usage, including Rails. Add it to your Gemfile:

# When using Rails.
gem 'mysql2-lambda'

# When NOT using Rails.
gem 'mysql2-lambda', require: 'mysql2'

Part of a suite of open source projects from Lamby: Simple Rails & AWS Lambda Integration using Rack. Details include:

  • Tested on Ruby 2.5.x & 2.7.x
  • Small Size! Only 5 Megabytes. No Lambda Layers needed!
  • Works with any MySQL connection. Including RDS Proxy.

Methodology

We used the amazon/aws-sam-cli-build-image-ruby2.5 Docker image from the 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.

$ ldd mysql2.so
  linux-vdso.so.1 =>  (0x00007ffcb15d4000)
  libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa8ebd21000)
  librt.so.1 => /lib64/librt.so.1 (0x00007fa8ebb19000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa8eb8fd000)
  libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007fa8eb687000)
  libdl.so.2 => /lib64/libdl.so.2 (0x00007fa8eb483000)
  libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fa8eb24c000)
  libm.so.6 => /lib64/libm.so.6 (0x00007fa8eaf4a000)
  libc.so.6 => /lib64/libc.so.6 (0x00007fa8eab7c000)
  libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa8ea966000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fa8ec72e000)
  libfreebl3.so => /lib64/libfreebl3.so (0x00007fa8ea764000)

Development

Clone or fork this repository, make sure you have Docker installed, then run the following commands.

./bin/setup
./bin/build

You will now have a packaged gem in the root of your project. Simple tests to make sure it works.

./bin/test 2.5
./bin/test 2.7

License

Thanks to all the contributors of the Mysql2 (https://github.com/brianmario/mysql2) gem. The license here is the same as that. MIT.

Code of Conduct

Everyone interacting in the Mysql2 Lambda project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 25 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc