departure 7.0.0 → 8.0.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.
@@ -1,290 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- departure (6.8.0)
5
- activerecord (>= 7.0.1)
6
- mysql2 (>= 0.4.0, < 0.6.0)
7
- railties (>= 7.0.1)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (8.0.2)
13
- actionpack (= 8.0.2)
14
- activesupport (= 8.0.2)
15
- nio4r (~> 2.0)
16
- websocket-driver (>= 0.6.1)
17
- zeitwerk (~> 2.6)
18
- actionmailbox (8.0.2)
19
- actionpack (= 8.0.2)
20
- activejob (= 8.0.2)
21
- activerecord (= 8.0.2)
22
- activestorage (= 8.0.2)
23
- activesupport (= 8.0.2)
24
- mail (>= 2.8.0)
25
- actionmailer (8.0.2)
26
- actionpack (= 8.0.2)
27
- actionview (= 8.0.2)
28
- activejob (= 8.0.2)
29
- activesupport (= 8.0.2)
30
- mail (>= 2.8.0)
31
- rails-dom-testing (~> 2.2)
32
- actionpack (8.0.2)
33
- actionview (= 8.0.2)
34
- activesupport (= 8.0.2)
35
- nokogiri (>= 1.8.5)
36
- rack (>= 2.2.4)
37
- rack-session (>= 1.0.1)
38
- rack-test (>= 0.6.3)
39
- rails-dom-testing (~> 2.2)
40
- rails-html-sanitizer (~> 1.6)
41
- useragent (~> 0.16)
42
- actiontext (8.0.2)
43
- actionpack (= 8.0.2)
44
- activerecord (= 8.0.2)
45
- activestorage (= 8.0.2)
46
- activesupport (= 8.0.2)
47
- globalid (>= 0.6.0)
48
- nokogiri (>= 1.8.5)
49
- actionview (8.0.2)
50
- activesupport (= 8.0.2)
51
- builder (~> 3.1)
52
- erubi (~> 1.11)
53
- rails-dom-testing (~> 2.2)
54
- rails-html-sanitizer (~> 1.6)
55
- activejob (8.0.2)
56
- activesupport (= 8.0.2)
57
- globalid (>= 0.3.6)
58
- activemodel (8.0.2)
59
- activesupport (= 8.0.2)
60
- activerecord (8.0.2)
61
- activemodel (= 8.0.2)
62
- activesupport (= 8.0.2)
63
- timeout (>= 0.4.0)
64
- activestorage (8.0.2)
65
- actionpack (= 8.0.2)
66
- activejob (= 8.0.2)
67
- activerecord (= 8.0.2)
68
- activesupport (= 8.0.2)
69
- marcel (~> 1.0)
70
- activesupport (8.0.2)
71
- base64
72
- benchmark (>= 0.3)
73
- bigdecimal
74
- concurrent-ruby (~> 1.0, >= 1.3.1)
75
- connection_pool (>= 2.2.5)
76
- drb
77
- i18n (>= 1.6, < 2)
78
- logger (>= 1.4.2)
79
- minitest (>= 5.1)
80
- securerandom (>= 0.3)
81
- tzinfo (~> 2.0, >= 2.0.5)
82
- uri (>= 0.13.1)
83
- appraisal (2.4.1)
84
- bundler
85
- rake
86
- thor (>= 0.14.0)
87
- ast (2.4.3)
88
- base64 (0.2.0)
89
- benchmark (0.4.0)
90
- bigdecimal (3.1.9)
91
- builder (3.3.0)
92
- byebug (12.0.0)
93
- climate_control (0.0.4)
94
- activesupport (>= 3.0)
95
- codeclimate-test-reporter (1.0.9)
96
- simplecov (<= 0.13)
97
- coderay (1.1.3)
98
- concurrent-ruby (1.3.5)
99
- connection_pool (2.5.0)
100
- crass (1.0.6)
101
- date (3.4.1)
102
- diff-lcs (1.6.1)
103
- docile (1.1.5)
104
- drb (2.2.1)
105
- erubi (1.13.1)
106
- globalid (1.2.1)
107
- activesupport (>= 6.1)
108
- i18n (1.14.7)
109
- concurrent-ruby (~> 1.0)
110
- io-console (0.8.0)
111
- irb (1.15.1)
112
- pp (>= 0.6.0)
113
- rdoc (>= 4.0.0)
114
- reline (>= 0.4.2)
115
- json (2.10.2)
116
- language_server-protocol (3.17.0.4)
117
- lhm (2.2.0)
118
- lint_roller (1.1.0)
119
- logger (1.7.0)
120
- loofah (2.24.0)
121
- crass (~> 1.0.2)
122
- nokogiri (>= 1.12.0)
123
- mail (2.8.1)
124
- mini_mime (>= 0.1.1)
125
- net-imap
126
- net-pop
127
- net-smtp
128
- marcel (1.0.4)
129
- method_source (1.1.0)
130
- mini_mime (1.1.5)
131
- minitest (5.25.5)
132
- mutex_m (0.3.0)
133
- mysql2 (0.5.6)
134
- net-imap (0.5.6)
135
- date
136
- net-protocol
137
- net-pop (0.1.2)
138
- net-protocol
139
- net-protocol (0.2.2)
140
- timeout
141
- net-smtp (0.5.1)
142
- net-protocol
143
- nio4r (2.7.4)
144
- nokogiri (1.18.6-arm64-darwin)
145
- racc (~> 1.4)
146
- nokogiri (1.18.6-x86_64-linux-gnu)
147
- racc (~> 1.4)
148
- parallel (1.26.3)
149
- parser (3.3.7.4)
150
- ast (~> 2.4.1)
151
- racc
152
- pp (0.6.2)
153
- prettyprint
154
- prettyprint (0.2.0)
155
- prism (1.4.0)
156
- pry (0.15.2)
157
- coderay (~> 1.1)
158
- method_source (~> 1.0)
159
- pry-byebug (3.11.0)
160
- byebug (~> 12.0)
161
- pry (>= 0.13, < 0.16)
162
- psych (5.2.3)
163
- date
164
- stringio
165
- racc (1.8.1)
166
- rack (3.1.12)
167
- rack-session (2.1.0)
168
- base64 (>= 0.1.0)
169
- rack (>= 3.0.0)
170
- rack-test (2.2.0)
171
- rack (>= 1.3)
172
- rackup (2.2.1)
173
- rack (>= 3)
174
- rails (8.0.2)
175
- actioncable (= 8.0.2)
176
- actionmailbox (= 8.0.2)
177
- actionmailer (= 8.0.2)
178
- actionpack (= 8.0.2)
179
- actiontext (= 8.0.2)
180
- actionview (= 8.0.2)
181
- activejob (= 8.0.2)
182
- activemodel (= 8.0.2)
183
- activerecord (= 8.0.2)
184
- activestorage (= 8.0.2)
185
- activesupport (= 8.0.2)
186
- bundler (>= 1.15.0)
187
- railties (= 8.0.2)
188
- rails-dom-testing (2.2.0)
189
- activesupport (>= 5.0.0)
190
- minitest
191
- nokogiri (>= 1.6)
192
- rails-html-sanitizer (1.6.2)
193
- loofah (~> 2.21)
194
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
195
- railties (8.0.2)
196
- actionpack (= 8.0.2)
197
- activesupport (= 8.0.2)
198
- irb (~> 1.13)
199
- rackup (>= 1.0.0)
200
- rake (>= 12.2)
201
- thor (~> 1.0, >= 1.2.2)
202
- zeitwerk (~> 2.6)
203
- rainbow (3.1.1)
204
- rake (13.2.1)
205
- rdoc (6.13.1)
206
- psych (>= 4.0.0)
207
- regexp_parser (2.10.0)
208
- reline (0.6.0)
209
- io-console (~> 0.5)
210
- rspec (3.13.0)
211
- rspec-core (~> 3.13.0)
212
- rspec-expectations (~> 3.13.0)
213
- rspec-mocks (~> 3.13.0)
214
- rspec-core (3.13.3)
215
- rspec-support (~> 3.13.0)
216
- rspec-expectations (3.13.3)
217
- diff-lcs (>= 1.2.0, < 2.0)
218
- rspec-support (~> 3.13.0)
219
- rspec-its (1.3.1)
220
- rspec-core (>= 3.0.0)
221
- rspec-expectations (>= 3.0.0)
222
- rspec-mocks (3.13.2)
223
- diff-lcs (>= 1.2.0, < 2.0)
224
- rspec-support (~> 3.13.0)
225
- rspec-support (3.13.2)
226
- rubocop (1.74.0)
227
- json (~> 2.3)
228
- language_server-protocol (~> 3.17.0.2)
229
- lint_roller (~> 1.1.0)
230
- parallel (~> 1.10)
231
- parser (>= 3.3.0.2)
232
- rainbow (>= 2.2.2, < 4.0)
233
- regexp_parser (>= 2.9.3, < 3.0)
234
- rubocop-ast (>= 1.38.0, < 2.0)
235
- ruby-progressbar (~> 1.7)
236
- unicode-display_width (>= 2.4.0, < 4.0)
237
- rubocop-ast (1.43.0)
238
- parser (>= 3.3.7.2)
239
- prism (~> 1.4)
240
- rubocop-performance (1.20.2)
241
- rubocop (>= 1.48.1, < 2.0)
242
- rubocop-ast (>= 1.30.0, < 2.0)
243
- ruby-progressbar (1.13.0)
244
- securerandom (0.4.1)
245
- simplecov (0.13.0)
246
- docile (~> 1.1.0)
247
- json (>= 1.8, < 3)
248
- simplecov-html (~> 0.10.0)
249
- simplecov-html (0.10.2)
250
- stringio (3.1.6)
251
- thor (1.3.2)
252
- timeout (0.4.3)
253
- tzinfo (2.0.6)
254
- concurrent-ruby (~> 1.0)
255
- unicode-display_width (3.1.4)
256
- unicode-emoji (~> 4.0, >= 4.0.4)
257
- unicode-emoji (4.0.4)
258
- uri (1.0.3)
259
- useragent (0.16.11)
260
- websocket-driver (0.7.7)
261
- base64
262
- websocket-extensions (>= 0.1.0)
263
- websocket-extensions (0.1.5)
264
- zeitwerk (2.6.18)
265
-
266
- PLATFORMS
267
- arm64-darwin-23
268
- arm64-darwin-24
269
- x86_64-linux
270
-
271
- DEPENDENCIES
272
- appraisal (~> 2.4.1)
273
- base64
274
- climate_control (~> 0.0.3)
275
- codeclimate-test-reporter (~> 1.0.3)
276
- departure!
277
- lhm
278
- logger
279
- mutex_m
280
- pry-byebug
281
- rails (> 7.1.3)
282
- rake (>= 10.0)
283
- rspec (~> 3.4, >= 3.4.0)
284
- rspec-its (~> 1.2)
285
- rubocop (~> 1.74.0)
286
- rubocop-performance (~> 1.20.2)
287
- zeitwerk (< 2.7.0)
288
-
289
- BUNDLED WITH
290
- 2.6.6
@@ -1,173 +0,0 @@
1
- require 'active_record/connection_adapters/abstract_mysql_adapter'
2
- require 'active_record/connection_adapters/statement_pool'
3
- require 'active_record/connection_adapters/mysql2_adapter'
4
- require 'active_record/connection_adapters/patch_connection_handling'
5
- require 'active_support/core_ext/string/filters'
6
- require 'departure'
7
- require 'forwardable'
8
-
9
- module ActiveRecord
10
- module ConnectionAdapters
11
- class DepartureAdapter < AbstractMysqlAdapter
12
- TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) } if defined?(initialize_type_map)
13
-
14
- class Column < ActiveRecord::ConnectionAdapters::MySQL::Column
15
- def adapter
16
- DepartureAdapter
17
- end
18
- end
19
-
20
- class SchemaCreation < ActiveRecord::ConnectionAdapters::MySQL::SchemaCreation
21
- def visit_DropForeignKey(name) # rubocop:disable Style/MethodName
22
- fk_name =
23
- if name =~ /^__(.+)/
24
- Regexp.last_match(1)
25
- else
26
- "_#{name}"
27
- end
28
-
29
- "DROP FOREIGN KEY #{fk_name}"
30
- end
31
- end
32
-
33
- extend Forwardable
34
-
35
- unless method_defined?(:change_column_for_alter)
36
- include ForAlterStatements
37
- end
38
-
39
- ADAPTER_NAME = 'Percona'.freeze
40
-
41
- def_delegators :mysql_adapter, :each_hash, :set_field_encoding
42
-
43
- def initialize(connection, _logger, connection_options, _config)
44
- @mysql_adapter = connection_options[:mysql_adapter]
45
- super
46
- @prepared_statements = false
47
- end
48
-
49
- def write_query?(sql) # :nodoc:
50
- !ActiveRecord::ConnectionAdapters::AbstractAdapter.build_read_query_regexp(
51
- :desc, :describe, :set, :show, :use
52
- ).match?(sql)
53
- end
54
-
55
- def exec_delete(sql, name, binds)
56
- execute(to_sql(sql, binds), name)
57
- mysql_adapter.raw_connection.affected_rows
58
- end
59
- alias exec_update exec_delete
60
-
61
- def exec_insert(sql, name, binds, pk = nil, sequence_name = nil, returning: nil) # rubocop:disable Lint/UnusedMethodArgument, Metrics/LineLength, Metrics/ParameterLists
62
- execute(to_sql(sql, binds), name)
63
- end
64
-
65
- def internal_exec_query(sql, name = 'SQL', _binds = [], **_kwargs) # :nodoc:
66
- result = execute(sql, name)
67
- fields = result.fields if defined?(result.fields)
68
- ActiveRecord::Result.new(fields, result.to_a)
69
- end
70
- alias exec_query internal_exec_query
71
-
72
- # Executes a SELECT query and returns an array of rows. Each row is an
73
- # array of field values.
74
-
75
- def select_rows(arel, name = nil, binds = [])
76
- select_all(arel, name, binds).rows
77
- end
78
-
79
- # Executes a SELECT query and returns an array of record hashes with the
80
- # column names as keys and column values as values.
81
- def select(sql, name = nil, binds = [], **kwargs)
82
- exec_query(sql, name, binds, **kwargs)
83
- end
84
-
85
- # Returns true, as this adapter supports migrations
86
- def supports_migrations?
87
- true
88
- end
89
-
90
- # rubocop:disable Metrics/ParameterLists
91
- def new_column(field, default, type_metadata, null, table_name, default_function, collation, comment)
92
- Column.new(field, default, type_metadata, null, table_name, default_function, collation, comment)
93
- end
94
- # rubocop:enable Metrics/ParameterLists
95
-
96
- # Adds a new index to the table
97
- #
98
- # @param table_name [String, Symbol]
99
- # @param column_name [String, Symbol]
100
- # @param options [Hash] optional
101
- def add_index(table_name, column_name, options = {})
102
- index_definition, = add_index_options(table_name, column_name, **options)
103
- execute <<-SQL.squish
104
- ALTER TABLE #{quote_table_name(index_definition.table)}
105
- ADD #{schema_creation.accept(index_definition)}
106
- SQL
107
- end
108
-
109
- # Remove the given index from the table.
110
- #
111
- # @param table_name [String, Symbol]
112
- # @param options [Hash] optional
113
- def remove_index(table_name, column_name = nil, **options)
114
- return if options[:if_exists] && !index_exists?(table_name, column_name, **options)
115
- index_name = index_name_for_remove(table_name, column_name, options)
116
-
117
- execute "ALTER TABLE #{quote_table_name(table_name)} DROP INDEX #{quote_column_name(index_name)}"
118
- end
119
-
120
- def schema_creation
121
- SchemaCreation.new(self)
122
- end
123
-
124
- def change_table(table_name, _options = {})
125
- recorder = ActiveRecord::Migration::CommandRecorder.new(self)
126
- yield update_table_definition(table_name, recorder)
127
- bulk_change_table(table_name, recorder.commands)
128
- end
129
-
130
- # Returns the MySQL error number from the exception. The
131
- # AbstractMysqlAdapter requires it to be implemented
132
- def error_number(_exception); end
133
-
134
- def full_version
135
- if ActiveRecord::VERSION::MAJOR < 6
136
- get_full_version
137
- else
138
- schema_cache.database_version.full_version_string
139
- end
140
- end
141
-
142
- # This is a method defined in Rails 6.0, and we have no control over the
143
- # naming of this method.
144
- def get_full_version # rubocop:disable Style/AccessorMethodName
145
- mysql_adapter.raw_connection.server_info[:version]
146
- end
147
-
148
- def last_inserted_id(result)
149
- mysql_adapter.send(:last_inserted_id, result)
150
- end
151
-
152
- private
153
-
154
- attr_reader :mysql_adapter
155
-
156
- if Departure::RailsAdapter.version_matches?(ActiveRecord.version, '~> 7.1.0')
157
- def raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)
158
- log(sql, name, async: async) do
159
- with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
160
- sync_timezone_changes(conn)
161
- result = conn.query(sql)
162
- verified!
163
- handle_warnings(sql)
164
- result
165
- end
166
- end
167
- end
168
- end
169
-
170
- def reconnect; end
171
- end
172
- end
173
- end