departure 6.4.0 → 6.5.0

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: 8e9b07d68819910b4f867268d8680b65677e6c11fe91b7f5c2f3a4b62cee627a
4
- data.tar.gz: daf4792210ea603d0732fae6daebe97fcbea253960067d800495b49b6c2aa866
3
+ metadata.gz: ee45de2b99d380a21a086335118fc3737d266e8e0404e9d817b87e5a9845d907
4
+ data.tar.gz: 72dc6b4c1ba181668e3ebc3ee0a723a490dd0b741cee1fa68bc35a3436ed5b63
5
5
  SHA512:
6
- metadata.gz: 1ba37179c249db07bc0770288ff6103ee4502846488319356bb2aad94738dd5727c42fea899e97aaccb974d5e0bd6f06d475ee0f922d460ec0cc2a2a0ad95f4b
7
- data.tar.gz: 9c5acbc1f3b3064341f371e584c3e3da4f326d9f3bfc9a32d844dccdd12bf50c4c6c4519c5742f086fbb4261e252fc31fa6c5cf5777f1d028da4e4798d127aa8
6
+ metadata.gz: 0bcd5216f4500f1e2f14d537ee0cf2c70de874e675e596216ba318ef4295898ff5d25f6b389ee966b925b49b9762ab5325030a9b333a08fe895624c0515be1d5
7
+ data.tar.gz: 3ec64dd81b991764c971ace8abaf1504270fcf9f56aa814c1ecf40e876b514657fab1f6c809dcdb2d4e2951ecade01aaf1a6bf37657deb38b81accc7e7e29010
data/CHANGELOG.md CHANGED
@@ -4,9 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
6
6
 
7
- ## [Unreleased]
7
+ ## [6.5.0] - 2023-01-24
8
8
 
9
- ## [6.4.0] - 2020-06-23
9
+ - Support mysql gem version 0.5.5
10
+ - Support for connection to MySQL server over socket
11
+ - Support appending items to the general DSN. Used to apply workaround for [PT-2126](https://jira.percona.com/browse/PT-2126)
12
+
13
+ ## [6.4.0] - 2022-08-24
10
14
 
11
15
  - Support for ActiveRecord 6.1.4
12
16
  - Relax mysql2 requirement to allow mysql2 0.5.4
data/config.yml.erb CHANGED
@@ -2,3 +2,4 @@ username: <%= ENV['PERCONA_DB_USER'] || 'root' %>
2
2
  password: <%= ENV['PERCONA_DB_PASSWORD'] || '' %>
3
3
  database: <%= ENV['PERCONA_DB_NAME'] || 'departure_test' %>
4
4
  hostname: <%= ENV['PERCONA_DB_HOST'] || 'localhost' %>
5
+ socket: <%= ENV['PERCONA_DB_SOCKET'] || '' %>
data/departure.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_runtime_dependency 'railties', *Array(RAILS_DEPENDENCY_VERSION)
27
27
  spec.add_runtime_dependency 'activerecord', *Array(RAILS_DEPENDENCY_VERSION)
28
- spec.add_runtime_dependency 'mysql2', '>= 0.4.0', '<= 0.5.4'
28
+ spec.add_runtime_dependency 'mysql2', '>= 0.4.0', '<= 0.5.5'
29
29
 
30
30
  spec.add_development_dependency 'rake', '>= 10.0'
31
31
  spec.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
@@ -5,7 +5,7 @@ module Departure
5
5
  DEFAULT_PORT = 3306
6
6
  # Constructor
7
7
  #
8
- # @param [Hash] connection parametes as used in #establish_conneciton
8
+ # @param connection_data [Hash] connection parameters as used in #establish_conneciton
9
9
  def initialize(connection_data)
10
10
  @connection_data = connection_data
11
11
  end
@@ -15,7 +15,7 @@ module Departure
15
15
  #
16
16
  # @return [String]
17
17
  def to_s
18
- @to_s ||= "#{host_argument} -P #{port} -u #{user} #{password_argument}"
18
+ @to_s ||= "#{base_connection} -u #{user} #{password_argument}"
19
19
  end
20
20
 
21
21
  # TODO: Doesn't the abstract adapter already handle this somehow?
@@ -40,6 +40,19 @@ module Departure
40
40
  end
41
41
  end
42
42
 
43
+ private
44
+
45
+ attr_reader :connection_data
46
+
47
+ # Returns conditionally host or socket configuration
48
+ #
49
+ # @return [String]
50
+ def base_connection
51
+ return socket_argument if socket.present?
52
+
53
+ "#{host_argument} -P #{port}"
54
+ end
55
+
43
56
  # Returns the host fragment of the details string, adds ssl options if needed
44
57
  #
45
58
  # @return [String]
@@ -51,9 +64,13 @@ module Departure
51
64
  "-h \"#{host_string}\""
52
65
  end
53
66
 
54
- private
55
-
56
- attr_reader :connection_data
67
+ # Returns the socket fragment of the details string
68
+ # FIXME: SSL connection
69
+ #
70
+ # @return [String]
71
+ def socket_argument
72
+ "-S #{socket}"
73
+ end
57
74
 
58
75
  # Returns the database host name, defaulting to localhost. If PERCONA_DB_HOST
59
76
  # is passed its value will be used instead
@@ -79,6 +96,14 @@ module Departure
79
96
  ENV.fetch('PERCONA_DB_PASSWORD', connection_data[:password])
80
97
  end
81
98
 
99
+ # Returns the database socket path. If PERCONA_DB_SOCKET is passed its value
100
+ # will be used instead
101
+ #
102
+ # @return [String]
103
+ def socket
104
+ ENV.fetch('PERCONA_DB_SOCKET', connection_data[:socket])
105
+ end
106
+
82
107
  # Returns the database's port.
83
108
  #
84
109
  # @return [String]
data/lib/departure/dsn.rb CHANGED
@@ -9,16 +9,17 @@ module Departure
9
9
  def initialize(database, table_name)
10
10
  @database = database
11
11
  @table_name = table_name
12
+ @suffix = ENV.fetch('PERCONA_DSN_SUFFIX', nil)
12
13
  end
13
14
 
14
15
  # Returns the pt-online-schema-change DSN string. See
15
16
  # https://www.percona.com/doc/percona-toolkit/2.0/pt-online-schema-change.html#dsn-options
16
17
  def to_s
17
- "D=#{database},t=#{table_name}"
18
+ "D=#{database},t=#{table_name}#{suffix.nil? ? nil : ',' + suffix}"
18
19
  end
19
20
 
20
21
  private
21
22
 
22
- attr_reader :table_name, :database
23
+ attr_reader :table_name, :database, :suffix
23
24
  end
24
25
  end
@@ -1,3 +1,3 @@
1
1
  module Departure
2
- VERSION = '6.4.0'.freeze
2
+ VERSION = '6.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: departure
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Zayats
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2022-08-04 00:00:00.000000000 Z
18
+ date: 2023-01-24 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: railties
@@ -78,7 +78,7 @@ dependencies:
78
78
  version: 0.4.0
79
79
  - - "<="
80
80
  - !ruby/object:Gem::Version
81
- version: 0.5.4
81
+ version: 0.5.5
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: 0.4.0
89
89
  - - "<="
90
90
  - !ruby/object:Gem::Version
91
- version: 0.5.4
91
+ version: 0.5.5
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: rake
94
94
  requirement: !ruby/object:Gem::Requirement
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  - !ruby/object:Gem::Version
246
246
  version: '0'
247
247
  requirements: []
248
- rubygems_version: 3.3.7
248
+ rubygems_version: 3.3.26
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: pt-online-schema-change runner for ActiveRecord migrations