sequel 5.61.0 → 5.62.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +32 -0
  3. data/README.rdoc +20 -19
  4. data/doc/advanced_associations.rdoc +13 -13
  5. data/doc/association_basics.rdoc +21 -15
  6. data/doc/cheat_sheet.rdoc +3 -3
  7. data/doc/model_hooks.rdoc +1 -1
  8. data/doc/object_model.rdoc +8 -8
  9. data/doc/opening_databases.rdoc +4 -4
  10. data/doc/postgresql.rdoc +8 -8
  11. data/doc/querying.rdoc +1 -1
  12. data/doc/release_notes/5.62.0.txt +132 -0
  13. data/doc/schema_modification.rdoc +1 -1
  14. data/doc/security.rdoc +9 -9
  15. data/doc/sql.rdoc +13 -13
  16. data/doc/testing.rdoc +13 -11
  17. data/doc/transactions.rdoc +6 -6
  18. data/doc/virtual_rows.rdoc +1 -1
  19. data/lib/sequel/adapters/postgres.rb +4 -0
  20. data/lib/sequel/adapters/shared/access.rb +9 -1
  21. data/lib/sequel/adapters/shared/mssql.rb +9 -5
  22. data/lib/sequel/adapters/shared/mysql.rb +7 -0
  23. data/lib/sequel/adapters/shared/oracle.rb +7 -0
  24. data/lib/sequel/adapters/shared/postgres.rb +275 -152
  25. data/lib/sequel/adapters/shared/sqlanywhere.rb +7 -0
  26. data/lib/sequel/adapters/shared/sqlite.rb +5 -0
  27. data/lib/sequel/connection_pool.rb +42 -28
  28. data/lib/sequel/database/connecting.rb +24 -0
  29. data/lib/sequel/database/misc.rb +8 -2
  30. data/lib/sequel/database/query.rb +37 -0
  31. data/lib/sequel/dataset/actions.rb +31 -11
  32. data/lib/sequel/dataset/features.rb +5 -0
  33. data/lib/sequel/dataset/misc.rb +1 -1
  34. data/lib/sequel/dataset/query.rb +9 -9
  35. data/lib/sequel/dataset/sql.rb +5 -1
  36. data/lib/sequel/extensions/_model_pg_row.rb +0 -12
  37. data/lib/sequel/extensions/_pretty_table.rb +1 -1
  38. data/lib/sequel/extensions/async_thread_pool.rb +11 -11
  39. data/lib/sequel/extensions/auto_literal_strings.rb +1 -1
  40. data/lib/sequel/extensions/constraint_validations.rb +1 -1
  41. data/lib/sequel/extensions/date_arithmetic.rb +1 -1
  42. data/lib/sequel/extensions/migration.rb +1 -1
  43. data/lib/sequel/extensions/named_timezones.rb +17 -5
  44. data/lib/sequel/extensions/pg_array.rb +22 -3
  45. data/lib/sequel/extensions/pg_auto_parameterize.rb +478 -0
  46. data/lib/sequel/extensions/pg_extended_date_support.rb +12 -0
  47. data/lib/sequel/extensions/pg_extended_integer_support.rb +116 -0
  48. data/lib/sequel/extensions/pg_hstore.rb +5 -0
  49. data/lib/sequel/extensions/pg_inet.rb +9 -10
  50. data/lib/sequel/extensions/pg_interval.rb +9 -10
  51. data/lib/sequel/extensions/pg_json.rb +10 -10
  52. data/lib/sequel/extensions/pg_multirange.rb +5 -10
  53. data/lib/sequel/extensions/pg_range.rb +5 -10
  54. data/lib/sequel/extensions/pg_row.rb +18 -13
  55. data/lib/sequel/model/associations.rb +7 -2
  56. data/lib/sequel/model/base.rb +6 -5
  57. data/lib/sequel/plugins/auto_validations.rb +53 -15
  58. data/lib/sequel/plugins/class_table_inheritance.rb +2 -2
  59. data/lib/sequel/plugins/composition.rb +2 -2
  60. data/lib/sequel/plugins/concurrent_eager_loading.rb +4 -4
  61. data/lib/sequel/plugins/dirty.rb +1 -1
  62. data/lib/sequel/plugins/finder.rb +3 -1
  63. data/lib/sequel/plugins/nested_attributes.rb +4 -4
  64. data/lib/sequel/plugins/pg_auto_constraint_validations.rb +1 -1
  65. data/lib/sequel/plugins/primary_key_lookup_check_values.rb +154 -0
  66. data/lib/sequel/plugins/sql_comments.rb +1 -1
  67. data/lib/sequel/plugins/validation_helpers.rb +20 -0
  68. data/lib/sequel/version.rb +1 -1
  69. metadata +10 -5
@@ -83,7 +83,9 @@ module Sequel
83
83
  :integer=>{:message=>lambda{"is not a number"}},
84
84
  :length_range=>{:message=>lambda{|range| "is too short or too long"}},
85
85
  :max_length=>{:message=>lambda{|max| "is longer than #{max} characters"}, :nil_message=>lambda{"is not present"}},
86
+ :max_value=>{:message=>lambda{|max| "is greater than maximum allowed value"}},
86
87
  :min_length=>{:message=>lambda{|min| "is shorter than #{min} characters"}},
88
+ :min_value=>{:message=>lambda{|min| "is less than minimum allowed value"}},
87
89
  :not_null=>{:message=>lambda{"is not present"}},
88
90
  :no_null_byte=>{:message=>lambda{"contains a null byte"}},
89
91
  :numeric=>{:message=>lambda{"is not a number"}},
@@ -141,11 +143,29 @@ module Sequel
141
143
  end
142
144
  end
143
145
 
146
+ # Check that the attribute values are not greater that the given maximum value.
147
+ # Does not perform validation if attribute value is nil.
148
+ # You should only call this if you have checked the attribute value has the expected type.
149
+ def validates_max_value(max, atts, opts=OPTS)
150
+ validatable_attributes_for_type(:max_value, atts, opts) do |a,v,m|
151
+ validation_error_message(m, max) if !v.nil? && v > max
152
+ end
153
+ end
154
+
144
155
  # Check that the attribute values are not shorter than the given min length.
145
156
  def validates_min_length(min, atts, opts=OPTS)
146
157
  validatable_attributes_for_type(:min_length, atts, opts){|a,v,m| validation_error_message(m, min) if v.nil? || v.length < min}
147
158
  end
148
159
 
160
+ # Check that the attribute values are not less that the given minimum value.
161
+ # Does not perform validation if attribute value is nil.
162
+ # You should only call this if you have checked the attribute value has the expected type.
163
+ def validates_min_value(min, atts, opts=OPTS)
164
+ validatable_attributes_for_type(:min_value, atts, opts) do |a,v,m|
165
+ validation_error_message(m, min) if !v.nil? && v < min
166
+ end
167
+ end
168
+
149
169
  # Check attribute value(s) are not NULL/nil.
150
170
  def validates_not_null(atts, opts=OPTS)
151
171
  validatable_attributes_for_type(:not_null, atts, opts){|a,v,m| validation_error_message(m) if v.nil?}
@@ -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 = 61
9
+ MINOR = 62
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.61.0
4
+ version: 5.62.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-01 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -193,6 +193,7 @@ extra_rdoc_files:
193
193
  - doc/release_notes/5.6.0.txt
194
194
  - doc/release_notes/5.60.0.txt
195
195
  - doc/release_notes/5.61.0.txt
196
+ - doc/release_notes/5.62.0.txt
196
197
  - doc/release_notes/5.7.0.txt
197
198
  - doc/release_notes/5.8.0.txt
198
199
  - doc/release_notes/5.9.0.txt
@@ -282,6 +283,7 @@ files:
282
283
  - doc/release_notes/5.6.0.txt
283
284
  - doc/release_notes/5.60.0.txt
284
285
  - doc/release_notes/5.61.0.txt
286
+ - doc/release_notes/5.62.0.txt
285
287
  - doc/release_notes/5.7.0.txt
286
288
  - doc/release_notes/5.8.0.txt
287
289
  - doc/release_notes/5.9.0.txt
@@ -420,8 +422,10 @@ files:
420
422
  - lib/sequel/extensions/pagination.rb
421
423
  - lib/sequel/extensions/pg_array.rb
422
424
  - lib/sequel/extensions/pg_array_ops.rb
425
+ - lib/sequel/extensions/pg_auto_parameterize.rb
423
426
  - lib/sequel/extensions/pg_enum.rb
424
427
  - lib/sequel/extensions/pg_extended_date_support.rb
428
+ - lib/sequel/extensions/pg_extended_integer_support.rb
425
429
  - lib/sequel/extensions/pg_hstore.rb
426
430
  - lib/sequel/extensions/pg_hstore_ops.rb
427
431
  - lib/sequel/extensions/pg_inet.rb
@@ -532,6 +536,7 @@ files:
532
536
  - lib/sequel/plugins/pg_row.rb
533
537
  - lib/sequel/plugins/prepared_statements.rb
534
538
  - lib/sequel/plugins/prepared_statements_safe.rb
539
+ - lib/sequel/plugins/primary_key_lookup_check_values.rb
535
540
  - lib/sequel/plugins/rcte_tree.rb
536
541
  - lib/sequel/plugins/require_valid_schema.rb
537
542
  - lib/sequel/plugins/serialization.rb
@@ -579,7 +584,7 @@ metadata:
579
584
  documentation_uri: https://sequel.jeremyevans.net/documentation.html
580
585
  mailing_list_uri: https://github.com/jeremyevans/sequel/discussions
581
586
  source_code_uri: https://github.com/jeremyevans/sequel
582
- post_install_message:
587
+ post_install_message:
583
588
  rdoc_options:
584
589
  - "--quiet"
585
590
  - "--line-numbers"
@@ -602,7 +607,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
602
607
  version: '0'
603
608
  requirements: []
604
609
  rubygems_version: 3.3.7
605
- signing_key:
610
+ signing_key:
606
611
  specification_version: 4
607
612
  summary: The Database Toolkit for Ruby
608
613
  test_files: []