sequel 5.51.0 → 5.54.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +44 -0
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +5 -0
  5. data/doc/opening_databases.rdoc +1 -1
  6. data/doc/release_notes/5.52.0.txt +87 -0
  7. data/doc/release_notes/5.53.0.txt +23 -0
  8. data/doc/release_notes/5.54.0.txt +27 -0
  9. data/doc/testing.rdoc +3 -1
  10. data/lib/sequel/adapters/amalgalite.rb +3 -5
  11. data/lib/sequel/adapters/jdbc/h2.rb +55 -10
  12. data/lib/sequel/adapters/jdbc.rb +12 -14
  13. data/lib/sequel/adapters/mysql.rb +80 -67
  14. data/lib/sequel/adapters/mysql2.rb +53 -48
  15. data/lib/sequel/adapters/postgres.rb +17 -21
  16. data/lib/sequel/adapters/shared/mysql.rb +3 -2
  17. data/lib/sequel/adapters/shared/postgres.rb +2 -2
  18. data/lib/sequel/adapters/sqlite.rb +16 -18
  19. data/lib/sequel/adapters/utils/mysql_mysql2.rb +1 -1
  20. data/lib/sequel/connection_pool/sharded_single.rb +5 -7
  21. data/lib/sequel/connection_pool/single.rb +6 -8
  22. data/lib/sequel/core.rb +17 -18
  23. data/lib/sequel/database/query.rb +1 -1
  24. data/lib/sequel/extensions/core_refinements.rb +36 -11
  25. data/lib/sequel/extensions/date_parse_input_handler.rb +67 -0
  26. data/lib/sequel/extensions/datetime_parse_to_time.rb +5 -1
  27. data/lib/sequel/extensions/pg_array_ops.rb +2 -2
  28. data/lib/sequel/extensions/pg_hstore_ops.rb +1 -1
  29. data/lib/sequel/extensions/pg_inet_ops.rb +1 -1
  30. data/lib/sequel/extensions/pg_interval.rb +1 -0
  31. data/lib/sequel/extensions/pg_json.rb +3 -5
  32. data/lib/sequel/extensions/pg_json_ops.rb +1 -1
  33. data/lib/sequel/extensions/pg_range_ops.rb +1 -1
  34. data/lib/sequel/extensions/pg_row_ops.rb +1 -1
  35. data/lib/sequel/extensions/s.rb +2 -1
  36. data/lib/sequel/extensions/server_block.rb +8 -12
  37. data/lib/sequel/extensions/sql_comments.rb +110 -3
  38. data/lib/sequel/extensions/string_date_time.rb +19 -23
  39. data/lib/sequel/model/base.rb +8 -12
  40. data/lib/sequel/plugins/column_encryption.rb +1 -1
  41. data/lib/sequel/plugins/enum.rb +124 -0
  42. data/lib/sequel/plugins/sql_comments.rb +189 -0
  43. data/lib/sequel/plugins/subclasses.rb +28 -11
  44. data/lib/sequel/plugins/unused_associations.rb +2 -2
  45. data/lib/sequel/timezones.rb +12 -14
  46. data/lib/sequel/version.rb +1 -1
  47. metadata +12 -3
@@ -313,7 +313,7 @@ module Sequel
313
313
  {}
314
314
  end
315
315
 
316
- ([self] + descendents).each do |sc|
316
+ ([self] + descendants).each do |sc|
317
317
  next if sc.associations.empty? || !sc.name
318
318
  module_mapping[sc.send(:overridable_methods_module)] = sc
319
319
  cov_data = coverage_data[sc.name] ||= {''=>[]}
@@ -348,7 +348,7 @@ module Sequel
348
348
 
349
349
  unused_associations_data = {}
350
350
 
351
- ([self] + descendents).each do |sc|
351
+ ([self] + descendants).each do |sc|
352
352
  next unless cov_data = coverage_data[sc.name]
353
353
  reflection_data = cov_data[''] || []
354
354
 
@@ -82,22 +82,20 @@ module Sequel
82
82
  # +application_timezone+ using +convert_input_timestamp+ and
83
83
  # +convert_output_timestamp+.
84
84
  def convert_timestamp(v, input_timezone)
85
- begin
86
- if v.is_a?(Date) && !v.is_a?(DateTime)
87
- # Dates handled specially as they are assumed to already be in the application_timezone
88
- if datetime_class == DateTime
89
- DateTime.civil(v.year, v.month, v.day, 0, 0, 0, application_timezone == :local ? Rational(Time.local(v.year, v.month, v.day).utc_offset, 86400) : 0)
90
- else
91
- Time.public_send(application_timezone == :utc ? :utc : :local, v.year, v.month, v.day)
92
- end
85
+ if v.is_a?(Date) && !v.is_a?(DateTime)
86
+ # Dates handled specially as they are assumed to already be in the application_timezone
87
+ if datetime_class == DateTime
88
+ DateTime.civil(v.year, v.month, v.day, 0, 0, 0, application_timezone == :local ? Rational(Time.local(v.year, v.month, v.day).utc_offset, 86400) : 0)
93
89
  else
94
- convert_output_timestamp(convert_input_timestamp(v, input_timezone), application_timezone)
90
+ Time.public_send(application_timezone == :utc ? :utc : :local, v.year, v.month, v.day)
95
91
  end
96
- rescue InvalidValue
97
- raise
98
- rescue => e
99
- raise convert_exception_class(e, InvalidValue)
92
+ else
93
+ convert_output_timestamp(convert_input_timestamp(v, input_timezone), application_timezone)
100
94
  end
95
+ rescue InvalidValue
96
+ raise
97
+ rescue => e
98
+ raise convert_exception_class(e, InvalidValue)
101
99
  end
102
100
 
103
101
  # Convert the given object into an object of <tt>Sequel.datetime_class</tt> in the
@@ -158,7 +156,7 @@ module Sequel
158
156
  case v
159
157
  when String
160
158
  v2 = Sequel.string_to_datetime(v)
161
- if !input_timezone || Date._parse(v).has_key?(:offset)
159
+ if !input_timezone || _date_parse(v).has_key?(:offset)
162
160
  v2
163
161
  else
164
162
  # Correct for potentially wrong offset if string doesn't include offset
@@ -6,7 +6,7 @@ module Sequel
6
6
 
7
7
  # The minor version of Sequel. Bumped for every non-patch level
8
8
  # release, generally around once a month.
9
- MINOR = 51
9
+ MINOR = 54
10
10
 
11
11
  # The tiny version of Sequel. Usually 0, only bumped for bugfix
12
12
  # releases that fix regressions from previous versions.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.51.0
4
+ version: 5.54.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-01 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -196,6 +196,9 @@ extra_rdoc_files:
196
196
  - doc/release_notes/5.5.0.txt
197
197
  - doc/release_notes/5.50.0.txt
198
198
  - doc/release_notes/5.51.0.txt
199
+ - doc/release_notes/5.52.0.txt
200
+ - doc/release_notes/5.53.0.txt
201
+ - doc/release_notes/5.54.0.txt
199
202
  - doc/release_notes/5.6.0.txt
200
203
  - doc/release_notes/5.7.0.txt
201
204
  - doc/release_notes/5.8.0.txt
@@ -275,6 +278,9 @@ files:
275
278
  - doc/release_notes/5.5.0.txt
276
279
  - doc/release_notes/5.50.0.txt
277
280
  - doc/release_notes/5.51.0.txt
281
+ - doc/release_notes/5.52.0.txt
282
+ - doc/release_notes/5.53.0.txt
283
+ - doc/release_notes/5.54.0.txt
278
284
  - doc/release_notes/5.6.0.txt
279
285
  - doc/release_notes/5.7.0.txt
280
286
  - doc/release_notes/5.8.0.txt
@@ -387,6 +393,7 @@ files:
387
393
  - lib/sequel/extensions/current_datetime_timestamp.rb
388
394
  - lib/sequel/extensions/dataset_source_alias.rb
389
395
  - lib/sequel/extensions/date_arithmetic.rb
396
+ - lib/sequel/extensions/date_parse_input_handler.rb
390
397
  - lib/sequel/extensions/datetime_parse_to_time.rb
391
398
  - lib/sequel/extensions/duplicate_columns_handler.rb
392
399
  - lib/sequel/extensions/empty_array_consider_nulls.rb
@@ -496,6 +503,7 @@ files:
496
503
  - lib/sequel/plugins/eager_each.rb
497
504
  - lib/sequel/plugins/eager_graph_eager.rb
498
505
  - lib/sequel/plugins/empty_failure_backtraces.rb
506
+ - lib/sequel/plugins/enum.rb
499
507
  - lib/sequel/plugins/error_splitter.rb
500
508
  - lib/sequel/plugins/finder.rb
501
509
  - lib/sequel/plugins/forbid_lazy_load.rb
@@ -530,6 +538,7 @@ files:
530
538
  - lib/sequel/plugins/skip_create_refresh.rb
531
539
  - lib/sequel/plugins/skip_saving_columns.rb
532
540
  - lib/sequel/plugins/split_values.rb
541
+ - lib/sequel/plugins/sql_comments.rb
533
542
  - lib/sequel/plugins/static_cache.rb
534
543
  - lib/sequel/plugins/static_cache_cache.rb
535
544
  - lib/sequel/plugins/string_stripper.rb
@@ -588,7 +597,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
588
597
  - !ruby/object:Gem::Version
589
598
  version: '0'
590
599
  requirements: []
591
- rubygems_version: 3.2.32
600
+ rubygems_version: 3.3.7
592
601
  signing_key:
593
602
  specification_version: 4
594
603
  summary: The Database Toolkit for Ruby