mysql2-lambda 0.5.3.beta.1 → 0.5.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c299be160d9fd775b4dd6fe756739f1d6c5df093e223086a9f6af3b6b6245054
4
- data.tar.gz: a530760bf5476f9ca400e0b7fe5ba057218acfef378295ae1df4a73e15a50d2c
3
+ metadata.gz: ff9854786e4e035845150ca0484848ea336ce9b6c22e67d2bd6500423f5c7e98
4
+ data.tar.gz: 334f76aaf4fa32061595148a0ec58952647315456d553cde92d6b25748135c3f
5
5
  SHA512:
6
- metadata.gz: 6947d3548d4343239a217a3bdc50442a215a0bfcc97fde58d594fb69dc50cc35f32322f055ccc2a69e84481b302c11c51271aadb34ccbe9dbd22d58a1dd78147
7
- data.tar.gz: 1197659df6365c2181b6eb6a9cd7dc5f95e4ca92c96bf46447ea1a299dc35a4d7249db0a69133159a7a29e3551ed1ac732868811a8b0331c1f8e6f79bd268cab
6
+ metadata.gz: 0b04235c2dae32e974e7df5163c5ea42d50c671f927dd2b103ebbbb9ceb39ca7e2b75767a89a698063a47fcf247020e7cc7ae040ed1776c352405179537a5abc
7
+ data.tar.gz: 2097cde86ff8541d668770f7ef3a0b3bf9431853dab9b7d43570a7244eeec3820fc4dfd83913c7b302c7ccb36f1d941a061af24ddbfe48e1a5c7461150b71982
data/BUILD ADDED
@@ -0,0 +1 @@
1
+ 2
data/CHANGELOG.md CHANGED
@@ -1 +1,10 @@
1
- Changes are maintained under [Releases](https://github.com/brianmario/mysql2/releases)
1
+ <!-- -*- mode: markdown -*- -->
2
+ # Keep A Changelog!
3
+
4
+ See this http://keepachangelog.com link for information on how we want this documented formatted.
5
+
6
+ ## v0.5.3.0
7
+
8
+ ### Added
9
+
10
+ - Initial Release!!! 🎉🎊🥳
data/README.md CHANGED
@@ -1,32 +1,65 @@
1
1
 
2
- # Lamby MySQL Layer
2
+ [![Test](https://github.com/customink/mysql2-lambda/actions/workflows/test.yml/badge.svg)](https://github.com/customink/mysql2-lambda/actions/workflows/test.yml)
3
3
 
4
- Installs dependencies for [customink/foundry](https://github.com/customink/foundry) on Lambda.
4
+ # Mysql2 Lambda Gem
5
5
 
6
- ## Usage
6
+ <a href="https://github.com/customink/lamby"><img src="https://user-images.githubusercontent.com/2381/59363668-89edeb80-8d03-11e9-9985-2ce14361b7e3.png" alt="Lamby: Simple Rails & AWS Lambda Integration using Rack." align="right" width="300" /></a>Very simple [Mysql2](https://github.com/brianmario/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:
7
7
 
8
- * Clone or fork this repository.
9
- * Make sure you have Docker or AWS CLI installed.
10
- * Run `./bin/deploy` or `./bin/deploy-${stage}` scripts.
11
8
 
12
- From there you simply use the arn in your AWS SAM `template.yaml` file.
9
+ ```ruby
10
+ # When using Rails.
11
+ gem 'mysql2-lambda'
13
12
 
14
- ## Dependencies
13
+ # When NOT using Rails.
14
+ gem 'mysql2-lambda', require: 'mysql2'
15
+ ```
16
+
17
+ Part of a suite of open source projects from **[Lamby: Simple Rails & AWS Lambda Integration using Rack.](https://github.com/customink/lamby)** Details include:
15
18
 
16
- ...
19
+ - Tested on Ruby 2.5.x & 2.7.x
20
+ - Small Size! Only 5 Megabytes. No Lambda Layers needed!
21
+ - Works with any MySQL connection. Including RDS Proxy.
17
22
 
18
- ## Layer Size
23
+ ## Methodology
19
24
 
20
- In `/opt/lib64/mysql`
25
+ We 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.
21
26
 
27
+ ```shell
28
+ $ ldd mysql2.so
29
+ linux-vdso.so.1 => (0x00007ffcb15d4000)
30
+ libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa8ebd21000)
31
+ librt.so.1 => /lib64/librt.so.1 (0x00007fa8ebb19000)
32
+ libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa8eb8fd000)
33
+ libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007fa8eb687000)
34
+ libdl.so.2 => /lib64/libdl.so.2 (0x00007fa8eb483000)
35
+ libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fa8eb24c000)
36
+ libm.so.6 => /lib64/libm.so.6 (0x00007fa8eaf4a000)
37
+ libc.so.6 => /lib64/libc.so.6 (0x00007fa8eab7c000)
38
+ libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa8ea966000)
39
+ /lib64/ld-linux-x86-64.so.2 (0x00007fa8ec72e000)
40
+ libfreebl3.so => /lib64/libfreebl3.so (0x00007fa8ea764000)
22
41
  ```
23
- lrwxrwxrwx 1 root 17 Jul 2 00:49 libmysqlclient_r.so -> libmysqlclient.so
24
- lrwxrwxrwx 1 root 20 Jul 2 00:49 libmysqlclient.so -> libmysqlclient.so.18
25
- lrwxrwxrwx 1 root 24 Jul 2 00:49 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
26
- -rwxr-xr-x 1 root 2983624 Dec 3 2018 libmysqlclient.so.18.0.0
42
+
43
+ ## Development
44
+
45
+ Clone or fork this repository, make sure you have Docker installed, then run the following commands.
46
+
47
+ ```shell
48
+ ./bin/setup
49
+ ./bin/build
27
50
  ```
28
51
 
52
+ You will now have a packaged gem in the root of your project. Simple tests to make sure it works.
29
53
 
30
- ## Methodology
54
+ ```shell
55
+ ./bin/test 2.5
56
+ ./bin/test 2.7
57
+ ```
58
+
59
+ ## License
60
+
61
+ Thanks to all the contributors of the `Mysql2` (https://github.com/brianmario/mysql2) gem. The license here is the same as that. MIT.
62
+
63
+ ## Code of Conduct
31
64
 
32
- We used the `lambci/lambda:build-ruby2.5` Docker image from the [docker-lambda](https://github.com/lambci/docker-lambda) project.
65
+ Everyone 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).
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.5.3
data/lib/mysql2/mysql2.so CHANGED
Binary file
@@ -0,0 +1,16 @@
1
+ # Not perfect. Simple `gem` hack to avoid the
2
+ # Mysql2Adapter in ActiveREcord from using rubygems.
3
+ #
4
+ if defined?(Rails)
5
+ $ORIG_GEM_METHOD = method(:gem)
6
+ kernel = (class << ::Kernel; self; end)
7
+ [kernel, ::Kernel].each do |k|
8
+ k.send :remove_method, :gem
9
+ k.send :define_method, :gem do |dep, *reqs|
10
+ unless ['mysql2'].include?(dep)
11
+ $ORIG_GEM_METHOD.call(dep, *reqs)
12
+ end
13
+ end
14
+ k.send :public, :gem
15
+ end
16
+ end
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mysql2-lambda'
3
- s.version = '0.5.3.beta.1'
3
+ s.version = "#{File.read('VERSION').strip}.#{File.read('BUILD').strip}"
4
4
  s.authors = ['Ken Collins']
5
5
  s.license = "MIT"
6
6
  s.email = ['kcollins@customink.com']
7
7
  s.homepage = 'https://github.com/customink/mysql2-lambda'
8
8
  s.rdoc_options = ['--charset=UTF-8']
9
- s.summary = 'Precompiled Mysql2 gem for AWS Lambda using MariaDB.'
9
+ s.summary = 'Precompiled Mysql2 gem for AWS Lambda.'
10
10
  s.metadata = {
11
11
  'bug_tracker_uri' => "#{s.homepage}/issues",
12
12
  'changelog_uri' => "#{s.homepage}/releases/tag/#{s.version}",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2-lambda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.beta.1
4
+ version: 0.5.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-04 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -17,9 +17,12 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - "./BUILD"
20
21
  - "./CHANGELOG.md"
21
22
  - "./LICENSE"
22
23
  - "./README.md"
24
+ - "./VERSION"
25
+ - "./lib/mysql2-lambda.rb"
23
26
  - "./lib/mysql2.rb"
24
27
  - "./lib/mysql2/client.rb"
25
28
  - "./lib/mysql2/console.rb"
@@ -36,9 +39,9 @@ licenses:
36
39
  - MIT
37
40
  metadata:
38
41
  bug_tracker_uri: https://github.com/customink/mysql2-lambda/issues
39
- changelog_uri: https://github.com/customink/mysql2-lambda/releases/tag/0.5.3.beta.1
42
+ changelog_uri: https://github.com/customink/mysql2-lambda/releases/tag/0.5.3.2
40
43
  homepage_uri: https://github.com/customink/mysql2-lambda
41
- source_code_uri: https://github.com/customink/mysql2-lambda/tree/0.5.3.beta.1
44
+ source_code_uri: https://github.com/customink/mysql2-lambda/tree/0.5.3.2
42
45
  post_install_message:
43
46
  rdoc_options:
44
47
  - "--charset=UTF-8"
@@ -51,12 +54,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
54
  version: 2.5.5
52
55
  required_rubygems_version: !ruby/object:Gem::Requirement
53
56
  requirements:
54
- - - ">"
57
+ - - ">="
55
58
  - !ruby/object:Gem::Version
56
- version: 1.3.1
59
+ version: '0'
57
60
  requirements: []
58
61
  rubygems_version: 3.1.2
59
62
  signing_key:
60
63
  specification_version: 4
61
- summary: Precompiled Mysql2 gem for AWS Lambda using MariaDB.
64
+ summary: Precompiled Mysql2 gem for AWS Lambda.
62
65
  test_files: []