makara 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +11 -0
- data/.github/workflows/CI.yml +88 -0
- data/.rspec +1 -1
- data/.rubocop.yml +15 -0
- data/.rubocop_todo.yml +670 -0
- data/CHANGELOG.md +14 -6
- data/Gemfile +1 -16
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/gemfiles/activerecord_5.2.gemfile +8 -0
- data/gemfiles/activerecord_6.0.gemfile +8 -0
- data/gemfiles/activerecord_6.1.gemfile +8 -0
- data/gemfiles/activerecord_head.gemfile +6 -0
- data/lib/active_record/connection_adapters/jdbcmysql_makara_adapter.rb +4 -18
- data/lib/active_record/connection_adapters/jdbcpostgresql_makara_adapter.rb +4 -18
- data/lib/active_record/connection_adapters/makara_abstract_adapter.rb +3 -31
- data/lib/active_record/connection_adapters/makara_jdbcmysql_adapter.rb +4 -18
- data/lib/active_record/connection_adapters/makara_jdbcpostgresql_adapter.rb +4 -18
- data/lib/active_record/connection_adapters/makara_mysql2_adapter.rb +4 -20
- data/lib/active_record/connection_adapters/makara_postgis_adapter.rb +4 -19
- data/lib/active_record/connection_adapters/makara_postgresql_adapter.rb +4 -20
- data/lib/active_record/connection_adapters/mysql2_makara_adapter.rb +4 -20
- data/lib/active_record/connection_adapters/postgresql_makara_adapter.rb +4 -20
- data/lib/makara.rb +0 -2
- data/lib/makara/cache.rb +0 -2
- data/lib/makara/config_parser.rb +5 -14
- data/lib/makara/connection_wrapper.rb +24 -27
- data/lib/makara/context.rb +1 -0
- data/lib/makara/cookie.rb +1 -0
- data/lib/makara/error_handler.rb +0 -9
- data/lib/makara/errors/all_connections_blacklisted.rb +0 -2
- data/lib/makara/errors/blacklist_connection.rb +0 -2
- data/lib/makara/errors/blacklisted_while_in_transaction.rb +0 -2
- data/lib/makara/errors/invalid_shard.rb +1 -3
- data/lib/makara/errors/makara_error.rb +0 -1
- data/lib/makara/errors/no_connections_available.rb +0 -2
- data/lib/makara/logging/logger.rb +0 -4
- data/lib/makara/logging/subscriber.rb +0 -2
- data/lib/makara/middleware.rb +1 -2
- data/lib/makara/pool.rb +2 -7
- data/lib/makara/proxy.rb +25 -27
- data/lib/makara/railtie.rb +0 -2
- data/lib/makara/strategies/abstract.rb +1 -0
- data/lib/makara/strategies/priority_failover.rb +2 -0
- data/lib/makara/strategies/round_robin.rb +1 -3
- data/lib/makara/strategies/shard_aware.rb +0 -2
- data/lib/makara/version.rb +1 -3
- data/makara.gemspec +24 -5
- data/spec/active_record/connection_adapters/makara_abstract_adapter_error_handling_spec.rb +1 -6
- data/spec/active_record/connection_adapters/makara_abstract_adapter_spec.rb +0 -9
- data/spec/active_record/connection_adapters/makara_mysql2_adapter_spec.rb +9 -22
- data/spec/active_record/connection_adapters/makara_postgis_adapter_spec.rb +2 -10
- data/spec/active_record/connection_adapters/makara_postgresql_adapter_spec.rb +7 -20
- data/spec/cache_spec.rb +0 -1
- data/spec/config_parser_spec.rb +54 -56
- data/spec/connection_wrapper_spec.rb +1 -2
- data/spec/cookie_spec.rb +1 -1
- data/spec/middleware_spec.rb +1 -1
- data/spec/pool_spec.rb +3 -16
- data/spec/proxy_spec.rb +0 -4
- data/spec/spec_helper.rb +5 -1
- data/spec/strategies/priority_failover_spec.rb +3 -4
- data/spec/strategies/round_robin_spec.rb +4 -8
- data/spec/strategies/shard_aware_spec.rb +4 -5
- data/spec/support/deep_dup.rb +1 -1
- data/spec/support/helpers.rb +5 -5
- data/spec/support/mock_objects.rb +1 -4
- data/spec/support/mysql2_database.yml +2 -2
- data/spec/support/mysql2_database_with_custom_errors.yml +2 -2
- data/spec/support/pool_extensions.rb +0 -3
- data/spec/support/postgis_schema.rb +1 -1
- data/spec/support/postgresql_database.yml +0 -2
- data/spec/support/proxy_extensions.rb +1 -3
- data/spec/support/schema.rb +1 -1
- data/spec/support/user.rb +1 -2
- metadata +156 -20
- data/.travis.yml +0 -131
- data/gemfiles/ar-head.gemfile +0 -24
- data/gemfiles/ar30.gemfile +0 -36
- data/gemfiles/ar31.gemfile +0 -36
- data/gemfiles/ar32.gemfile +0 -36
- data/gemfiles/ar40.gemfile +0 -24
- data/gemfiles/ar41.gemfile +0 -24
- data/gemfiles/ar42.gemfile +0 -24
- data/gemfiles/ar50.gemfile +0 -24
- data/gemfiles/ar51.gemfile +0 -24
- data/gemfiles/ar52.gemfile +0 -24
- data/gemfiles/ar60.gemfile +0 -24
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## Unreleased
|
5
|
+
|
6
|
+
### v0.5.1 - 2021-06-04
|
7
|
+
[Full Changelog](https://github.com/instacart/makara/compare/v0.5.0...v0.6.0.pre)
|
8
|
+
- Use ActiveRecord URL resolver instead of copying definition [#294](https://github.com/instacart/makara/pull/294) Matt Larraz
|
9
|
+
- Fix Ruby 2.7 kwarg warning and add Ruby 3 support [#283](https://github.com/instacart/makara/pull/283) Matt Larraz
|
10
|
+
- Drop support for Ruby < 2.5 and ActiveRecord < 5.2 [#281](https://github.com/instacart/makara/pull/281) Matt Larraz
|
11
|
+
|
4
12
|
## v0.5.0 - 2021-01-08
|
5
13
|
[Full Changelog](https://github.com/instacart/makara/compare/v0.4.1...v0.4.2)
|
6
14
|
- Replace deprecated URI.unescape with CGI.unescape [#252](https://github.com/instacart/makara/pull/252) Kevin Robatel
|
7
15
|
- Override equality operator for ActiveRecord connection wrapper [#269](https://github.com/instacart/makara/pull/269) Praveen Burgu
|
8
|
-
- Handle blacklisted connections in master pool while in transaction [#267]
|
9
|
-
- Handle ActiveRecord connection pools correctly [#267]
|
10
|
-
- Add preliminary support for sharded databases [#267]
|
11
|
-
- Fix ActiveRecord connection pool exhaustion [#268]
|
12
|
-
- Drop support for Ruby 2.0, 2.1 and 2.2 [#267]
|
13
|
-
- Drop support ActiveRecord 3.x and 4.x [#267]
|
16
|
+
- Handle blacklisted connections in master pool while in transaction [#267](https://github.com/instacart/makara/pull/267) Praveen Burgu
|
17
|
+
- Handle ActiveRecord connection pools correctly [#267](https://github.com/instacart/makara/pull/267) Praveen Burgu
|
18
|
+
- Add preliminary support for sharded databases [#267](https://github.com/instacart/makara/pull/267) Praveen Burgu
|
19
|
+
- Fix ActiveRecord connection pool exhaustion [#268](https://github.com/instacart/makara/pull/268) Praveen Burgu
|
20
|
+
- Drop support for Ruby 2.0, 2.1 and 2.2 [#267](https://github.com/instacart/makara/pull/267) Praveen Burgu
|
21
|
+
- Drop support ActiveRecord 3.x and 4.x [#267](https://github.com/instacart/makara/pull/267) Praveen Burgu
|
14
22
|
- Set up automatic publishing to Github and Rubygems [#275](https://github.com/instacart/makara/pull/275) Matt Larraz
|
15
23
|
|
16
24
|
|
data/Gemfile
CHANGED
@@ -1,19 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in makara.gemspec
|
4
4
|
gemspec
|
5
|
-
|
6
|
-
gem 'rake'
|
7
|
-
gem 'rspec'
|
8
|
-
gem 'timecop'
|
9
|
-
gem 'byebug', :platform => :ruby
|
10
|
-
gem 'ruby-debug', :platform => :jruby
|
11
|
-
gem 'rack', '2.2.3'
|
12
|
-
|
13
|
-
gem 'mysql2', :platform => :ruby
|
14
|
-
gem 'pg', '0.21.0', :platform => :ruby
|
15
|
-
gem 'activerecord-postgis-adapter', :platform => :ruby
|
16
|
-
gem 'rgeo', :platform => :ruby
|
17
|
-
|
18
|
-
gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
|
19
|
-
gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Makara
|
2
2
|
|
3
|
-
|
3
|
+
![Build Status](https://github.com/instacart/makara/workflows/CI/badge.svg)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/makara.svg)](https://badge.fury.io/rb/makara)
|
4
5
|
[![Code Climate](https://codeclimate.com/repos/526886a7f3ea00679b00cae6/badges/7905f7a000492a1078f7/gpa.png)](https://codeclimate.com/repos/526886a7f3ea00679b00cae6/feed)
|
5
6
|
|
6
7
|
|
data/Rakefile
CHANGED
@@ -2,24 +2,10 @@ require 'active_record/connection_adapters/makara_abstract_adapter'
|
|
2
2
|
require 'active_record/connection_adapters/jdbcmysql_adapter'
|
3
3
|
require 'active_record/connection_adapters/mysql2_makara_adapter'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def jdbcmysql_makara_connection(config)
|
10
|
-
mysql2_makara_connection(config)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
else
|
16
|
-
|
17
|
-
module ActiveRecord
|
18
|
-
class Base
|
19
|
-
def self.jdbcmysql_makara_connection(config)
|
20
|
-
self.mysql2_makara_connection(config)
|
21
|
-
end
|
5
|
+
module ActiveRecord
|
6
|
+
module ConnectionHandling
|
7
|
+
def jdbcmysql_makara_connection(config)
|
8
|
+
mysql2_makara_connection(config)
|
22
9
|
end
|
23
10
|
end
|
24
|
-
|
25
11
|
end
|
@@ -2,24 +2,10 @@ require 'active_record/connection_adapters/makara_abstract_adapter'
|
|
2
2
|
require 'active_record/connection_adapters/jdbcpostgresql_adapter'
|
3
3
|
require 'active_record/connection_adapters/postgresql_makara_adapter'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def jdbcpostgresql_makara_connection(config)
|
10
|
-
postgresql_makara_connection(config)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
else
|
16
|
-
|
17
|
-
module ActiveRecord
|
18
|
-
class Base
|
19
|
-
def self.jdbcpostgresql_makara_connection(config)
|
20
|
-
self.postgresql_makara_connection(config)
|
21
|
-
end
|
5
|
+
module ActiveRecord
|
6
|
+
module ConnectionHandling
|
7
|
+
def jdbcpostgresql_makara_connection(config)
|
8
|
+
postgresql_makara_connection(config)
|
22
9
|
end
|
23
10
|
end
|
24
|
-
|
25
11
|
end
|
@@ -4,18 +4,13 @@ require 'makara'
|
|
4
4
|
module ActiveRecord
|
5
5
|
module ConnectionAdapters
|
6
6
|
class MakaraAbstractAdapter < ::Makara::Proxy
|
7
|
-
|
8
|
-
|
9
7
|
class ErrorHandler < ::Makara::ErrorHandler
|
10
|
-
|
11
|
-
|
12
8
|
HARSH_ERRORS = [
|
13
9
|
'ActiveRecord::RecordNotUnique',
|
14
10
|
'ActiveRecord::InvalidForeignKey',
|
15
11
|
'Makara::Errors::BlacklistConnection'
|
16
12
|
].map(&:freeze).freeze
|
17
13
|
|
18
|
-
|
19
14
|
CONNECTION_MATCHERS = [
|
20
15
|
/(closed|lost|no|terminating|terminated)\s?([^\s]+)?\sconnection/,
|
21
16
|
/gone away/,
|
@@ -32,11 +27,8 @@ module ActiveRecord
|
|
32
27
|
/the database system is (starting|shutting)/
|
33
28
|
].map(&:freeze).freeze
|
34
29
|
|
35
|
-
|
36
30
|
def handle(connection)
|
37
|
-
|
38
31
|
yield
|
39
|
-
|
40
32
|
rescue Exception => e
|
41
33
|
# do it via class name to avoid version-specific constant dependencies
|
42
34
|
case e.class.name
|
@@ -49,20 +41,16 @@ module ActiveRecord
|
|
49
41
|
harshly(e)
|
50
42
|
end
|
51
43
|
end
|
52
|
-
|
53
44
|
end
|
54
45
|
|
55
|
-
|
56
46
|
def harsh_errors
|
57
47
|
HARSH_ERRORS
|
58
48
|
end
|
59
49
|
|
60
|
-
|
61
50
|
def connection_matchers
|
62
51
|
CONNECTION_MATCHERS
|
63
52
|
end
|
64
53
|
|
65
|
-
|
66
54
|
def connection_message?(message)
|
67
55
|
message = message.to_s.downcase
|
68
56
|
|
@@ -74,7 +62,6 @@ module ActiveRecord
|
|
74
62
|
end
|
75
63
|
end
|
76
64
|
|
77
|
-
|
78
65
|
def custom_error_message?(connection, message)
|
79
66
|
custom_error_matchers = connection._makara_custom_error_matchers
|
80
67
|
return false if custom_error_matchers.empty?
|
@@ -82,7 +69,6 @@ module ActiveRecord
|
|
82
69
|
message = message.to_s
|
83
70
|
|
84
71
|
custom_error_matchers.each do |matcher|
|
85
|
-
|
86
72
|
if matcher.is_a?(String)
|
87
73
|
|
88
74
|
# accept strings that look like "/.../" as a regex
|
@@ -101,54 +87,43 @@ module ActiveRecord
|
|
101
87
|
|
102
88
|
false
|
103
89
|
end
|
104
|
-
|
105
|
-
|
106
90
|
end
|
107
91
|
|
108
|
-
|
109
92
|
hijack_method :execute, :exec_query, :exec_no_cache, :exec_cache, :transaction
|
110
93
|
send_to_all :connect, :reconnect!, :verify!, :clear_cache!, :reset!
|
111
94
|
|
112
95
|
control_method :close, :steal!, :expire, :lease, :in_use?, :owner, :schema_cache, :pool=, :pool,
|
113
96
|
:schema_cache=, :lock, :seconds_idle, :==
|
114
97
|
|
115
|
-
|
116
98
|
SQL_MASTER_MATCHERS = [/\A\s*select.+for update\Z/i, /select.+lock in share mode\Z/i, /\A\s*select.+(nextval|currval|lastval|get_lock|release_lock|pg_advisory_lock|pg_advisory_unlock)\(/i].map(&:freeze).freeze
|
117
99
|
SQL_SLAVE_MATCHERS = [/\A\s*(select|with.+\)\s*select)\s/i].map(&:freeze).freeze
|
118
100
|
SQL_ALL_MATCHERS = [/\A\s*set\s/i].map(&:freeze).freeze
|
119
101
|
SQL_SKIP_STICKINESS_MATCHERS = [/\A\s*show\s([\w]+\s)?(field|table|database|schema|view|index)(es|s)?/i, /\A\s*(set|describe|explain|pragma)\s/i].map(&:freeze).freeze
|
120
102
|
|
121
|
-
|
122
103
|
def sql_master_matchers
|
123
104
|
SQL_MASTER_MATCHERS
|
124
105
|
end
|
125
106
|
|
126
|
-
|
127
107
|
def sql_slave_matchers
|
128
108
|
SQL_SLAVE_MATCHERS
|
129
109
|
end
|
130
110
|
|
131
|
-
|
132
111
|
def sql_all_matchers
|
133
112
|
SQL_ALL_MATCHERS
|
134
113
|
end
|
135
114
|
|
136
|
-
|
137
115
|
def sql_skip_stickiness_matchers
|
138
116
|
SQL_SKIP_STICKINESS_MATCHERS
|
139
117
|
end
|
140
118
|
|
141
|
-
|
142
119
|
def initialize(config)
|
143
120
|
@error_handler = ::ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter::ErrorHandler.new
|
144
121
|
@control = ActiveRecordPoolControl.new(self)
|
145
122
|
super(config)
|
146
123
|
end
|
147
124
|
|
148
|
-
|
149
125
|
protected
|
150
126
|
|
151
|
-
|
152
127
|
def appropriate_connection(method_name, args, &block)
|
153
128
|
if needed_by_all?(method_name, args)
|
154
129
|
|
@@ -169,29 +144,28 @@ module ActiveRecord
|
|
169
144
|
end
|
170
145
|
end
|
171
146
|
|
172
|
-
|
173
147
|
def should_stick?(method_name, args)
|
174
148
|
sql = coerce_query_to_sql_string(args.first)
|
175
149
|
return false if sql_skip_stickiness_matchers.any?{|m| sql =~ m }
|
150
|
+
|
176
151
|
super
|
177
152
|
end
|
178
153
|
|
179
|
-
|
180
154
|
def needed_by_all?(method_name, args)
|
181
155
|
sql = coerce_query_to_sql_string(args.first)
|
182
156
|
return true if sql_all_matchers.any?{|m| sql =~ m }
|
157
|
+
|
183
158
|
false
|
184
159
|
end
|
185
160
|
|
186
|
-
|
187
161
|
def needs_master?(method_name, args)
|
188
162
|
sql = coerce_query_to_sql_string(args.first)
|
189
163
|
return true if sql_master_matchers.any?{|m| sql =~ m }
|
190
164
|
return false if sql_slave_matchers.any?{|m| sql =~ m }
|
165
|
+
|
191
166
|
true
|
192
167
|
end
|
193
168
|
|
194
|
-
|
195
169
|
def coerce_query_to_sql_string(sql_or_arel)
|
196
170
|
if sql_or_arel.respond_to?(:to_sql)
|
197
171
|
sql_or_arel.to_sql
|
@@ -200,13 +174,11 @@ module ActiveRecord
|
|
200
174
|
end
|
201
175
|
end
|
202
176
|
|
203
|
-
|
204
177
|
def connection_for(config)
|
205
178
|
config = Makara::ConfigParser.merge_and_resolve_default_url_config(config)
|
206
179
|
active_record_connection_for(config)
|
207
180
|
end
|
208
181
|
|
209
|
-
|
210
182
|
def active_record_connection_for(config)
|
211
183
|
raise NotImplementedError
|
212
184
|
end
|
@@ -2,24 +2,10 @@ require 'active_record/connection_adapters/makara_abstract_adapter'
|
|
2
2
|
require 'active_record/connection_adapters/jdbcmysql_adapter'
|
3
3
|
require 'active_record/connection_adapters/makara_mysql2_adapter'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def makara_jdbcmysql_connection(config)
|
10
|
-
makara_mysql2_connection(config)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
else
|
16
|
-
|
17
|
-
module ActiveRecord
|
18
|
-
class Base
|
19
|
-
def self.makara_jdbcmysql_connection(config)
|
20
|
-
self.makara_mysql2_connection(config)
|
21
|
-
end
|
5
|
+
module ActiveRecord
|
6
|
+
module ConnectionHandling
|
7
|
+
def makara_jdbcmysql_connection(config)
|
8
|
+
makara_mysql2_connection(config)
|
22
9
|
end
|
23
10
|
end
|
24
|
-
|
25
11
|
end
|
@@ -2,24 +2,10 @@ require 'active_record/connection_adapters/makara_abstract_adapter'
|
|
2
2
|
require 'active_record/connection_adapters/jdbcpostgresql_adapter'
|
3
3
|
require 'active_record/connection_adapters/makara_postgresql_adapter'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def makara_jdbcpostgresql_connection(config)
|
10
|
-
makara_postgresql_connection(config)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
else
|
16
|
-
|
17
|
-
module ActiveRecord
|
18
|
-
class Base
|
19
|
-
def self.makara_jdbcpostgresql_connection(config)
|
20
|
-
self.makara_postgresql_connection(config)
|
21
|
-
end
|
5
|
+
module ActiveRecord
|
6
|
+
module ConnectionHandling
|
7
|
+
def makara_jdbcpostgresql_connection(config)
|
8
|
+
makara_postgresql_connection(config)
|
22
9
|
end
|
23
10
|
end
|
24
|
-
|
25
11
|
end
|
@@ -1,32 +1,17 @@
|
|
1
1
|
require 'active_record/connection_adapters/makara_abstract_adapter'
|
2
2
|
require 'active_record/connection_adapters/mysql2_adapter'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def makara_mysql2_connection(config)
|
9
|
-
ActiveRecord::ConnectionAdapters::MakaraMysql2Adapter.new(config)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
else
|
15
|
-
|
16
|
-
module ActiveRecord
|
17
|
-
class Base
|
18
|
-
def self.makara_mysql2_connection(config)
|
19
|
-
ActiveRecord::ConnectionAdapters::MakaraMysql2Adapter.new(config)
|
20
|
-
end
|
4
|
+
module ActiveRecord
|
5
|
+
module ConnectionHandling
|
6
|
+
def makara_mysql2_connection(config)
|
7
|
+
ActiveRecord::ConnectionAdapters::MakaraMysql2Adapter.new(config)
|
21
8
|
end
|
22
9
|
end
|
23
|
-
|
24
10
|
end
|
25
11
|
|
26
12
|
module ActiveRecord
|
27
13
|
module ConnectionAdapters
|
28
14
|
class MakaraMysql2Adapter < ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter
|
29
|
-
|
30
15
|
class << self
|
31
16
|
def visitor_for(*args)
|
32
17
|
ActiveRecord::ConnectionAdapters::Mysql2Adapter.visitor_for(*args)
|
@@ -38,7 +23,6 @@ module ActiveRecord
|
|
38
23
|
def active_record_connection_for(config)
|
39
24
|
::ActiveRecord::Base.mysql2_connection(config)
|
40
25
|
end
|
41
|
-
|
42
26
|
end
|
43
27
|
end
|
44
28
|
end
|
@@ -1,29 +1,14 @@
|
|
1
1
|
require 'active_record/connection_adapters/makara_abstract_adapter'
|
2
2
|
require 'active_record/connection_adapters/postgis_adapter'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def makara_postgis_connection(config)
|
9
|
-
ActiveRecord::ConnectionAdapters::MakaraPostgisAdapter.new(config)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
else
|
15
|
-
|
16
|
-
module ActiveRecord
|
17
|
-
class Base
|
18
|
-
def self.makara_postgis_connection(config)
|
19
|
-
ActiveRecord::ConnectionAdapters::MakaraPostgisAdapter.new(config)
|
20
|
-
end
|
4
|
+
module ActiveRecord
|
5
|
+
module ConnectionHandling
|
6
|
+
def makara_postgis_connection(config)
|
7
|
+
ActiveRecord::ConnectionAdapters::MakaraPostgisAdapter.new(config)
|
21
8
|
end
|
22
9
|
end
|
23
|
-
|
24
10
|
end
|
25
11
|
|
26
|
-
|
27
12
|
module ActiveRecord
|
28
13
|
module ConnectionAdapters
|
29
14
|
class MakaraPostgisAdapter < ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter
|