mysql2-lambda 0.5.3.beta.2 → 0.5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18ace6b226d09fad441022771a358cf17f21f2e3b049f735b7cb617240561b11
4
- data.tar.gz: 7a8f8b40e828d2455238352a644f8e8a4aaa22d48faeccb9dbe132c710797aab
3
+ metadata.gz: 887d1117dc8c532af8498c0d3a662e3ec52780b81383cc7f6c2c2e05acef3de7
4
+ data.tar.gz: 5dee6353eaf94b987220507d7253575eefd0983bb017c36ef6c799bad476dac6
5
5
  SHA512:
6
- metadata.gz: b41ac49e97c856304f60b0180952ec105c979f5268093685520c3ca6e5808c901952aaa5956abd6ac080050df49d60214c44f56ff33219f703020543063ed4a2
7
- data.tar.gz: 945d710ee925f50346579f6d02ae4a8b021738121f6bd3e60760c8533514a2365f1b827c260c72fcccc4671d29c9e597b4f7506793fe699161e85edfc30b0398
6
+ metadata.gz: 7bcb69c69bb9d28b7712882edd92d05acb13c3fc62f35ef9d60871b061505943f2abf79d0f7fde04c0a02e4b5192c8417b9d98d7cc5c2b9af5d0741067e84689
7
+ data.tar.gz: d61dbf797db6643911e5872c373fa84160cf28d19040f92f9dba37c27f4132e9fd69def015269d88124b83495362efd3e033a0f1901d0d7943e1ef94167dce7f
@@ -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,52 @@
1
+ # MySQL2 Lambda Gem
1
2
 
2
- # Lamby MySQL Layer
3
+ <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.
3
4
 
4
- Installs dependencies for [customink/foundry](https://github.com/customink/foundry) on Lambda.
5
-
6
- ## Usage
5
+ ```ruby
6
+ gem 'mysql2-lambda'
7
+ ```
7
8
 
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.
9
+ Part of a suite of open source projects from **[Lamby: Simple Rails & AWS Lambda Integration using Rack.](https://github.com/customink/lamby)** Details include:
11
10
 
12
- From there you simply use the arn in your AWS SAM `template.yaml` file.
11
+ - Tested on Ruby 2.5.x & 2.7.x
12
+ - Small Size! Only 5 Megabytes. No Lambda Layers needed!
13
+ - Works with any MySQL connection. Including RDS Proxy.
13
14
 
14
- ## Dependencies
15
+ ## Methodology
15
16
 
16
- ...
17
+ We used the `lambci/lambda:build-ruby2.5` Docker image from the [docker-lambda](https://github.com/lambci/docker-lambda) 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.
18
+
19
+ ```shell
20
+ $ ldd mysql2.so
21
+ linux-vdso.so.1 => (0x00007ffcb15d4000)
22
+ libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa8ebd21000)
23
+ librt.so.1 => /lib64/librt.so.1 (0x00007fa8ebb19000)
24
+ libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa8eb8fd000)
25
+ libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007fa8eb687000)
26
+ libdl.so.2 => /lib64/libdl.so.2 (0x00007fa8eb483000)
27
+ libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fa8eb24c000)
28
+ libm.so.6 => /lib64/libm.so.6 (0x00007fa8eaf4a000)
29
+ libc.so.6 => /lib64/libc.so.6 (0x00007fa8eab7c000)
30
+ libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa8ea966000)
31
+ /lib64/ld-linux-x86-64.so.2 (0x00007fa8ec72e000)
32
+ libfreebl3.so => /lib64/libfreebl3.so (0x00007fa8ea764000)
33
+ ```
17
34
 
18
- ## Layer Size
35
+ ## Development
19
36
 
20
- In `/opt/lib64/mysql`
37
+ Clone or fork this repository, make sure you have Docker installed, then run the following commands.
21
38
 
22
- ```
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
39
+ ```shell
40
+ ./bin/setup
41
+ ./bin/build
27
42
  ```
28
43
 
44
+ You will now have a packaged gem in the root of your project.
29
45
 
30
- ## Methodology
46
+ ## License
47
+
48
+ Thanks to all the contributors of the `Mysql2` (https://github.com/brianmario/mysql2) gem. The license here is the same as that. MIT.
49
+
50
+ ## Code of Conduct
31
51
 
32
- We used the `lambci/lambda:build-ruby2.5` Docker image from the [docker-lambda](https://github.com/lambci/docker-lambda) project.
52
+ 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).
@@ -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.2'
3
+ s.version = '0.5.3.0'
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2-lambda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3.beta.2
4
+ version: 0.5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -20,6 +20,7 @@ files:
20
20
  - "./CHANGELOG.md"
21
21
  - "./LICENSE"
22
22
  - "./README.md"
23
+ - "./lib/mysql2-lambda.rb"
23
24
  - "./lib/mysql2.rb"
24
25
  - "./lib/mysql2/client.rb"
25
26
  - "./lib/mysql2/console.rb"
@@ -36,9 +37,9 @@ licenses:
36
37
  - MIT
37
38
  metadata:
38
39
  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.2
40
+ changelog_uri: https://github.com/customink/mysql2-lambda/releases/tag/0.5.3.0
40
41
  homepage_uri: https://github.com/customink/mysql2-lambda
41
- source_code_uri: https://github.com/customink/mysql2-lambda/tree/0.5.3.beta.2
42
+ source_code_uri: https://github.com/customink/mysql2-lambda/tree/0.5.3.0
42
43
  post_install_message:
43
44
  rdoc_options:
44
45
  - "--charset=UTF-8"
@@ -51,12 +52,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
52
  version: 2.5.5
52
53
  required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  requirements:
54
- - - ">"
55
+ - - ">="
55
56
  - !ruby/object:Gem::Version
56
- version: 1.3.1
57
+ version: '0'
57
58
  requirements: []
58
59
  rubygems_version: 3.1.2
59
60
  signing_key:
60
61
  specification_version: 4
61
- summary: Precompiled Mysql2 gem for AWS Lambda using MariaDB.
62
+ summary: Precompiled Mysql2 gem for AWS Lambda.
62
63
  test_files: []