makara 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +11 -0
  3. data/.github/workflows/CI.yml +88 -0
  4. data/.rspec +1 -1
  5. data/.rubocop.yml +15 -0
  6. data/.rubocop_todo.yml +670 -0
  7. data/CHANGELOG.md +14 -6
  8. data/Gemfile +1 -16
  9. data/README.md +2 -1
  10. data/Rakefile +1 -1
  11. data/gemfiles/activerecord_5.2.gemfile +8 -0
  12. data/gemfiles/activerecord_6.0.gemfile +8 -0
  13. data/gemfiles/activerecord_6.1.gemfile +8 -0
  14. data/gemfiles/activerecord_head.gemfile +6 -0
  15. data/lib/active_record/connection_adapters/jdbcmysql_makara_adapter.rb +4 -18
  16. data/lib/active_record/connection_adapters/jdbcpostgresql_makara_adapter.rb +4 -18
  17. data/lib/active_record/connection_adapters/makara_abstract_adapter.rb +3 -31
  18. data/lib/active_record/connection_adapters/makara_jdbcmysql_adapter.rb +4 -18
  19. data/lib/active_record/connection_adapters/makara_jdbcpostgresql_adapter.rb +4 -18
  20. data/lib/active_record/connection_adapters/makara_mysql2_adapter.rb +4 -20
  21. data/lib/active_record/connection_adapters/makara_postgis_adapter.rb +4 -19
  22. data/lib/active_record/connection_adapters/makara_postgresql_adapter.rb +4 -20
  23. data/lib/active_record/connection_adapters/mysql2_makara_adapter.rb +4 -20
  24. data/lib/active_record/connection_adapters/postgresql_makara_adapter.rb +4 -20
  25. data/lib/makara.rb +0 -2
  26. data/lib/makara/cache.rb +0 -2
  27. data/lib/makara/config_parser.rb +5 -14
  28. data/lib/makara/connection_wrapper.rb +24 -27
  29. data/lib/makara/context.rb +1 -0
  30. data/lib/makara/cookie.rb +1 -0
  31. data/lib/makara/error_handler.rb +0 -9
  32. data/lib/makara/errors/all_connections_blacklisted.rb +0 -2
  33. data/lib/makara/errors/blacklist_connection.rb +0 -2
  34. data/lib/makara/errors/blacklisted_while_in_transaction.rb +0 -2
  35. data/lib/makara/errors/invalid_shard.rb +1 -3
  36. data/lib/makara/errors/makara_error.rb +0 -1
  37. data/lib/makara/errors/no_connections_available.rb +0 -2
  38. data/lib/makara/logging/logger.rb +0 -4
  39. data/lib/makara/logging/subscriber.rb +0 -2
  40. data/lib/makara/middleware.rb +1 -2
  41. data/lib/makara/pool.rb +2 -7
  42. data/lib/makara/proxy.rb +25 -27
  43. data/lib/makara/railtie.rb +0 -2
  44. data/lib/makara/strategies/abstract.rb +1 -0
  45. data/lib/makara/strategies/priority_failover.rb +2 -0
  46. data/lib/makara/strategies/round_robin.rb +1 -3
  47. data/lib/makara/strategies/shard_aware.rb +0 -2
  48. data/lib/makara/version.rb +1 -3
  49. data/makara.gemspec +24 -5
  50. data/spec/active_record/connection_adapters/makara_abstract_adapter_error_handling_spec.rb +1 -6
  51. data/spec/active_record/connection_adapters/makara_abstract_adapter_spec.rb +0 -9
  52. data/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb +9 -22
  53. data/spec/active_record/connection_adapters/makara_postgis_adapter_spec.rb +2 -10
  54. data/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb +7 -20
  55. data/spec/cache_spec.rb +0 -1
  56. data/spec/config_parser_spec.rb +54 -56
  57. data/spec/connection_wrapper_spec.rb +1 -2
  58. data/spec/cookie_spec.rb +1 -1
  59. data/spec/middleware_spec.rb +1 -1
  60. data/spec/pool_spec.rb +3 -16
  61. data/spec/proxy_spec.rb +0 -4
  62. data/spec/spec_helper.rb +5 -1
  63. data/spec/strategies/priority_failover_spec.rb +3 -4
  64. data/spec/strategies/round_robin_spec.rb +4 -8
  65. data/spec/strategies/shard_aware_spec.rb +4 -5
  66. data/spec/support/deep_dup.rb +1 -1
  67. data/spec/support/helpers.rb +5 -5
  68. data/spec/support/mock_objects.rb +1 -4
  69. data/spec/support/mysql2_database.yml +2 -2
  70. data/spec/support/mysql2_database_with_custom_errors.yml +2 -2
  71. data/spec/support/pool_extensions.rb +0 -3
  72. data/spec/support/postgis_schema.rb +1 -1
  73. data/spec/support/postgresql_database.yml +0 -2
  74. data/spec/support/proxy_extensions.rb +1 -3
  75. data/spec/support/schema.rb +1 -1
  76. data/spec/support/user.rb +1 -2
  77. metadata +156 -20
  78. data/.travis.yml +0 -131
  79. data/gemfiles/ar-head.gemfile +0 -24
  80. data/gemfiles/ar30.gemfile +0 -36
  81. data/gemfiles/ar31.gemfile +0 -36
  82. data/gemfiles/ar32.gemfile +0 -36
  83. data/gemfiles/ar40.gemfile +0 -24
  84. data/gemfiles/ar41.gemfile +0 -24
  85. data/gemfiles/ar42.gemfile +0 -24
  86. data/gemfiles/ar50.gemfile +0 -24
  87. data/gemfiles/ar51.gemfile +0 -24
  88. data/gemfiles/ar52.gemfile +0 -24
  89. data/gemfiles/ar60.gemfile +0 -24
@@ -1,36 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '3.2.6'
9
- gem 'rspec'
10
- gem 'rack', '1.6.0'
11
- gem 'i18n', '~> 0.6.0'
12
- gem 'mysql2', '~> 0.3.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
15
-
16
-
17
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
18
-
19
- if rmajor == 1 && rminor == 8
20
- gem 'timecop', '0.5.9'
21
- else
22
- gem 'timecop'
23
- end
24
-
25
- # 1.8 - 1.9.2
26
- if rmajor == 1 && (rminor == 8 || (rminor == 9 && rpatch < 3))
27
- gem 'pg', '0.17.1', :platform => :ruby
28
- else
29
- gem 'pg', '0.21.0', :platform => :ruby
30
- end
31
-
32
- # 2.1 +
33
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
34
- gem 'activerecord-postgis-adapter', :platform => :ruby
35
- gem 'rgeo', :platform => :ruby
36
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '4.0.0'
9
- gem 'rspec'
10
- gem 'rack', '1.6.0'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.3.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '4.1.0'
9
- gem 'rspec'
10
- gem 'rack', '1.6.0'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.3.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '~> 4.2.0'
9
- gem 'rspec'
10
- gem 'rack', '1.6.0'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.3.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '~> 5.0.0'
9
- gem 'rspec'
10
- gem 'rack'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.4.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '~> 5.1.0'
9
- gem 'rspec'
10
- gem 'rack'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.4.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '~> 5.2.0'
9
- gem 'rspec'
10
- gem 'rack'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.4.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in makara.gemspec
4
- gemspec :path => '../'
5
-
6
-
7
- gem 'rake'
8
- gem 'activerecord', '~> 6.0.0'
9
- gem 'rspec'
10
- gem 'rack'
11
- gem 'timecop'
12
- gem 'mysql2', '~> 0.4.10', :platform => :ruby
13
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
14
- gem 'pg', '0.21.0', :platform => :ruby
15
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
16
-
17
-
18
- rmajor, rminor, rpatch = RUBY_VERSION.split(/[^\d]/)[0..2].map(&:to_i)
19
-
20
- # 2.1 +
21
- if rmajor > 2 || (rmajor == 2 && rminor >= 1)
22
- gem 'activerecord-postgis-adapter', :platform => :ruby
23
- gem 'rgeo', :platform => :ruby
24
- end