sequel 4.47.0 → 4.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +134 -0
  3. data/Rakefile +1 -1
  4. data/doc/release_notes/4.48.0.txt +293 -0
  5. data/lib/sequel/adapters/ado/access.rb +2 -1
  6. data/lib/sequel/adapters/do/postgres.rb +5 -2
  7. data/lib/sequel/adapters/ibmdb.rb +24 -7
  8. data/lib/sequel/adapters/jdbc.rb +36 -22
  9. data/lib/sequel/adapters/jdbc/db2.rb +12 -3
  10. data/lib/sequel/adapters/jdbc/derby.rb +4 -5
  11. data/lib/sequel/adapters/jdbc/oracle.rb +16 -2
  12. data/lib/sequel/adapters/jdbc/postgresql.rb +43 -18
  13. data/lib/sequel/adapters/jdbc/sqlanywhere.rb +9 -7
  14. data/lib/sequel/adapters/jdbc/sqlserver.rb +11 -4
  15. data/lib/sequel/adapters/mock.rb +24 -19
  16. data/lib/sequel/adapters/mysql.rb +17 -16
  17. data/lib/sequel/adapters/mysql2.rb +4 -5
  18. data/lib/sequel/adapters/oracle.rb +5 -9
  19. data/lib/sequel/adapters/postgres.rb +89 -102
  20. data/lib/sequel/adapters/shared/db2.rb +22 -6
  21. data/lib/sequel/adapters/shared/mssql.rb +5 -4
  22. data/lib/sequel/adapters/shared/mysql.rb +75 -24
  23. data/lib/sequel/adapters/shared/postgres.rb +196 -94
  24. data/lib/sequel/adapters/shared/sqlanywhere.rb +23 -10
  25. data/lib/sequel/adapters/shared/sqlite.rb +72 -82
  26. data/lib/sequel/adapters/sqlanywhere.rb +4 -1
  27. data/lib/sequel/adapters/sqlite.rb +5 -3
  28. data/lib/sequel/adapters/swift/postgres.rb +5 -2
  29. data/lib/sequel/adapters/tinytds.rb +0 -5
  30. data/lib/sequel/adapters/utils/mysql_mysql2.rb +1 -1
  31. data/lib/sequel/adapters/utils/pg_types.rb +2 -76
  32. data/lib/sequel/core.rb +2 -2
  33. data/lib/sequel/database/connecting.rb +5 -5
  34. data/lib/sequel/database/dataset.rb +6 -3
  35. data/lib/sequel/database/misc.rb +1 -1
  36. data/lib/sequel/database/query.rb +3 -0
  37. data/lib/sequel/database/schema_methods.rb +1 -1
  38. data/lib/sequel/dataset/actions.rb +18 -10
  39. data/lib/sequel/dataset/graph.rb +1 -1
  40. data/lib/sequel/dataset/misc.rb +1 -0
  41. data/lib/sequel/dataset/prepared_statements.rb +3 -3
  42. data/lib/sequel/dataset/query.rb +19 -8
  43. data/lib/sequel/extensions/core_extensions.rb +4 -1
  44. data/lib/sequel/extensions/duplicate_columns_handler.rb +1 -1
  45. data/lib/sequel/extensions/empty_array_ignore_nulls.rb +3 -0
  46. data/lib/sequel/extensions/filter_having.rb +2 -0
  47. data/lib/sequel/extensions/freeze_datasets.rb +2 -0
  48. data/lib/sequel/extensions/from_block.rb +1 -1
  49. data/lib/sequel/extensions/graph_each.rb +2 -2
  50. data/lib/sequel/extensions/hash_aliases.rb +2 -0
  51. data/lib/sequel/extensions/identifier_mangling.rb +0 -7
  52. data/lib/sequel/extensions/meta_def.rb +2 -0
  53. data/lib/sequel/extensions/migration.rb +6 -6
  54. data/lib/sequel/extensions/no_auto_literal_strings.rb +1 -1
  55. data/lib/sequel/extensions/pagination.rb +1 -1
  56. data/lib/sequel/extensions/pg_array.rb +207 -130
  57. data/lib/sequel/extensions/pg_hstore.rb +38 -20
  58. data/lib/sequel/extensions/pg_inet.rb +18 -6
  59. data/lib/sequel/extensions/pg_interval.rb +19 -12
  60. data/lib/sequel/extensions/pg_json.rb +25 -14
  61. data/lib/sequel/extensions/pg_json_ops.rb +2 -2
  62. data/lib/sequel/extensions/pg_range.rb +133 -100
  63. data/lib/sequel/extensions/pg_range_ops.rb +4 -3
  64. data/lib/sequel/extensions/pg_row.rb +68 -39
  65. data/lib/sequel/extensions/pg_row_ops.rb +11 -5
  66. data/lib/sequel/extensions/query_literals.rb +2 -0
  67. data/lib/sequel/extensions/ruby18_symbol_extensions.rb +2 -0
  68. data/lib/sequel/extensions/s.rb +1 -1
  69. data/lib/sequel/extensions/schema_dumper.rb +24 -24
  70. data/lib/sequel/extensions/sequel_3_dataset_methods.rb +3 -1
  71. data/lib/sequel/extensions/sequel_4_dataset_methods.rb +83 -0
  72. data/lib/sequel/extensions/set_overrides.rb +2 -2
  73. data/lib/sequel/extensions/string_agg.rb +0 -1
  74. data/lib/sequel/extensions/symbol_aref.rb +0 -4
  75. data/lib/sequel/model.rb +25 -57
  76. data/lib/sequel/model/associations.rb +14 -5
  77. data/lib/sequel/model/base.rb +96 -32
  78. data/lib/sequel/plugins/association_pks.rb +73 -46
  79. data/lib/sequel/plugins/association_proxies.rb +1 -1
  80. data/lib/sequel/plugins/auto_validations.rb +6 -2
  81. data/lib/sequel/plugins/boolean_readers.rb +1 -1
  82. data/lib/sequel/plugins/caching.rb +19 -13
  83. data/lib/sequel/plugins/class_table_inheritance.rb +19 -10
  84. data/lib/sequel/plugins/column_conflicts.rb +7 -2
  85. data/lib/sequel/plugins/column_select.rb +1 -1
  86. data/lib/sequel/plugins/csv_serializer.rb +8 -8
  87. data/lib/sequel/plugins/defaults_setter.rb +10 -0
  88. data/lib/sequel/plugins/eager_each.rb +1 -1
  89. data/lib/sequel/plugins/force_encoding.rb +2 -2
  90. data/lib/sequel/plugins/hook_class_methods.rb +9 -12
  91. data/lib/sequel/plugins/identifier_columns.rb +2 -0
  92. data/lib/sequel/plugins/instance_filters.rb +3 -1
  93. data/lib/sequel/plugins/instance_hooks.rb +17 -9
  94. data/lib/sequel/plugins/json_serializer.rb +17 -10
  95. data/lib/sequel/plugins/lazy_attributes.rb +8 -7
  96. data/lib/sequel/plugins/modification_detection.rb +3 -0
  97. data/lib/sequel/plugins/nested_attributes.rb +5 -1
  98. data/lib/sequel/plugins/pg_array_associations.rb +5 -0
  99. data/lib/sequel/plugins/prepared_statements.rb +1 -0
  100. data/lib/sequel/plugins/rcte_tree.rb +4 -4
  101. data/lib/sequel/plugins/serialization.rb +3 -10
  102. data/lib/sequel/plugins/single_table_inheritance.rb +2 -2
  103. data/lib/sequel/plugins/split_values.rb +6 -5
  104. data/lib/sequel/plugins/static_cache.rb +31 -25
  105. data/lib/sequel/plugins/subset_conditions.rb +3 -1
  106. data/lib/sequel/plugins/table_select.rb +1 -1
  107. data/lib/sequel/plugins/touch.rb +2 -1
  108. data/lib/sequel/plugins/validation_class_methods.rb +5 -6
  109. data/lib/sequel/plugins/validation_helpers.rb +2 -4
  110. data/lib/sequel/plugins/xml_serializer.rb +4 -4
  111. data/lib/sequel/sql.rb +2 -2
  112. data/lib/sequel/version.rb +1 -1
  113. data/spec/adapters/db2_spec.rb +115 -14
  114. data/spec/adapters/mysql_spec.rb +78 -28
  115. data/spec/adapters/oracle_spec.rb +24 -24
  116. data/spec/adapters/postgres_spec.rb +38 -24
  117. data/spec/adapters/sqlanywhere_spec.rb +88 -86
  118. data/spec/adapters/sqlite_spec.rb +29 -24
  119. data/spec/core/connection_pool_spec.rb +17 -0
  120. data/spec/core/database_spec.rb +6 -0
  121. data/spec/core/dataset_spec.rb +46 -36
  122. data/spec/core/schema_spec.rb +16 -0
  123. data/spec/core/spec_helper.rb +1 -0
  124. data/spec/core_extensions_spec.rb +6 -2
  125. data/spec/extensions/active_model_spec.rb +1 -1
  126. data/spec/extensions/arbitrary_servers_spec.rb +1 -1
  127. data/spec/extensions/association_pks_spec.rb +34 -2
  128. data/spec/extensions/auto_literal_strings_spec.rb +5 -1
  129. data/spec/extensions/auto_validations_spec.rb +2 -0
  130. data/spec/extensions/boolean_readers_spec.rb +1 -1
  131. data/spec/extensions/boolean_subsets_spec.rb +1 -1
  132. data/spec/extensions/class_table_inheritance_spec.rb +48 -2
  133. data/spec/extensions/column_conflicts_spec.rb +11 -0
  134. data/spec/extensions/connection_validator_spec.rb +1 -1
  135. data/spec/extensions/dataset_associations_spec.rb +8 -8
  136. data/spec/extensions/defaults_setter_spec.rb +1 -1
  137. data/spec/extensions/filter_having_spec.rb +5 -3
  138. data/spec/extensions/hash_aliases_spec.rb +3 -1
  139. data/spec/extensions/identifier_columns_spec.rb +3 -1
  140. data/spec/extensions/implicit_subquery_spec.rb +4 -2
  141. data/spec/extensions/json_serializer_spec.rb +18 -0
  142. data/spec/extensions/lazy_attributes_spec.rb +3 -3
  143. data/spec/extensions/meta_def_spec.rb +9 -0
  144. data/spec/extensions/migration_spec.rb +3 -3
  145. data/spec/extensions/nested_attributes_spec.rb +14 -3
  146. data/spec/extensions/no_auto_literal_strings_spec.rb +8 -4
  147. data/spec/extensions/pg_array_associations_spec.rb +29 -18
  148. data/spec/extensions/pg_array_spec.rb +44 -25
  149. data/spec/extensions/pg_hstore_spec.rb +10 -0
  150. data/spec/extensions/pg_inet_spec.rb +26 -0
  151. data/spec/extensions/pg_interval_spec.rb +20 -0
  152. data/spec/extensions/pg_json_spec.rb +24 -0
  153. data/spec/extensions/pg_range_spec.rb +98 -14
  154. data/spec/extensions/pg_row_spec.rb +14 -4
  155. data/spec/extensions/prepared_statements_safe_spec.rb +1 -1
  156. data/spec/extensions/query_literals_spec.rb +3 -1
  157. data/spec/extensions/schema_dumper_spec.rb +96 -98
  158. data/spec/extensions/sequel_3_dataset_methods_spec.rb +10 -6
  159. data/spec/extensions/sequel_4_dataset_methods_spec.rb +121 -0
  160. data/spec/extensions/single_table_inheritance_spec.rb +1 -1
  161. data/spec/extensions/spec_helper.rb +7 -1
  162. data/spec/extensions/static_cache_spec.rb +75 -24
  163. data/spec/extensions/string_agg_spec.rb +1 -1
  164. data/spec/extensions/touch_spec.rb +9 -0
  165. data/spec/extensions/validation_helpers_spec.rb +9 -3
  166. data/spec/extensions/whitelist_security_spec.rb +26 -0
  167. data/spec/integration/dataset_test.rb +45 -44
  168. data/spec/integration/plugin_test.rb +20 -0
  169. data/spec/integration/prepared_statement_test.rb +3 -0
  170. data/spec/integration/schema_test.rb +21 -1
  171. data/spec/integration/transaction_test.rb +40 -40
  172. data/spec/model/class_dataset_methods_spec.rb +14 -4
  173. data/spec/model/dataset_methods_spec.rb +12 -3
  174. data/spec/model/model_spec.rb +8 -0
  175. metadata +6 -4
  176. data/spec/adapters/firebird_spec.rb +0 -405
  177. data/spec/adapters/informix_spec.rb +0 -100
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4d1bdb365601ad2d67120764a7211a4c12ecff3
4
- data.tar.gz: 1e1a3e0d8fb915792b66a91e96577ba0c522c9b6
3
+ metadata.gz: b093264594c435f6dee3a24f2245dd8a84f3a739
4
+ data.tar.gz: 92d8d17d4d092f86d8d20d015fa86da8422005b5
5
5
  SHA512:
6
- metadata.gz: 47bd614656335d42c4d5f2dbe1fbf9ead5143975b2d57b06c982a26039e5d7bb359470e1ffead7993be9651bafb706a174cd99e26fff7786833d96d02b311275
7
- data.tar.gz: 2ab2a499dc1cd2dd45fa7f9bf3a58e902742a4a087f297918b634f535c59953d26bee14aee90e8111142d38d703a5c8bc05966139d93f410f79ea236af5e0f11
6
+ metadata.gz: 451903d4f3abb15ce7395afdb6052ba9b60e30b895b413b8bdb74067dce03a6b748c2357a89a65eda6a6620d7dce85f007fba1be4b796954ff530d744c4b927b
7
+ data.tar.gz: 003675d934cf08064143725513b42857aaffa99de6586a5a3bf57bb0f6d241428379a2bdc643de7eaf947c89cb4d1c2310c904e6697ad1b60023a85c6db9ec1d
data/CHANGELOG CHANGED
@@ -1,3 +1,137 @@
1
+ === 4.48.0 (2017-07-01)
2
+
3
+ * Deprecate Model.<< (jeremyevans)
4
+
5
+ * Deprecate Dataset#{and,exclude_where,range,interval}, move to sequel_4_dataset_methods extension (jeremyevans)
6
+
7
+ * Make Database#indexes not include partial indexes on SQLite 3.8.8+ (jeremyevans)
8
+
9
+ * Make Database#indexes include indexes created automatically from unique constraints on SQLite 3.8.8+ (jeremyevans)
10
+
11
+ * Deprecate Sequel::Postgres::PG_TYPES, conversion procs should not be registered per-Database (jeremyevans)
12
+
13
+ * Add Database#add_conversion_proc method on PostgreSQL for registering conversion procs (jeremyevans)
14
+
15
+ * Deprecate unexpected values passed to Dataset#insert_conflict on SQLite (jeremyevans)
16
+
17
+ * Deprecate Sequel::SqlAnywhere::Dataset#convert_smallint_to_bool= method (jeremyevans)
18
+
19
+ * Deprecate Sequel::SqlAnywhere.convert_smallint_to_bool accessor (jeremyevans)
20
+
21
+ * Use savepoints around index creation if creating table inside transaction if ignore_index_errors is used (jeremyevans)
22
+
23
+ * Deprecate treating :natrual_inner join type on MySQL as NATURAL LEFT JOIN (jeremyevans)
24
+
25
+ * Deprecate Dataset#mssql_unicode_strings= on Microsoft SQL Server (jeremyevans)
26
+
27
+ * Preserve encoding when parsing PostgreSQL arrays (jeltz) (#1387)
28
+
29
+ * Deprecate external modification of Sequel::JDBC::TypeConvertor (jeremyevans)
30
+
31
+ * Deprecate Sequel::DB2.use_clob_as_blob accessor (jeremyevans)
32
+
33
+ * Add Database#use_clob_as_blob accessor on DB2 (jeremyevans)
34
+
35
+ * Deprecate SEQUEL_POSTGRES_USES_PG constant (jeremyevans)
36
+
37
+ * Do not swallow original exception if exception is raised inside Database#copy_table on PostgreSQL (jeremyevans)
38
+
39
+ * Deprecate Sequel::Postgres.client_min_messages and force_standard_strings accessors (jeremyevans)
40
+
41
+ * Deprecate Sequel::Postgres.use_iso_date_format accessor (jeremyevans)
42
+
43
+ * Do not allow connection in postgres adapter if postgres-pr driver is used and force_standard_strings is false (jeremyevans)
44
+
45
+ * Drop support for ancient postgres driver in postgres adapter, now only pg and postgres-pr drivers are supported (jeremyevans)
46
+
47
+ * Deprecate Sequel::MySQL.convert_invalid_date_time accessor (jeremyevans)
48
+
49
+ * Deprecate Sequel::MySQL.convert_tinyint_to_bool accessor (jeremyevans)
50
+
51
+ * Deprecate Sequel::MySQL.default_{charset,collate,engine} accessors (jeremyevans)
52
+
53
+ * Add Database#default_{charset,collate,engine} accessors on MySQL (jeremyevans)
54
+
55
+ * Make mock adapter thread safe (jeremyevans)
56
+
57
+ * Deprecate Sequel::JDBC::Dataset#convert_types accessor (jeremyevans)
58
+
59
+ * Add Dataset#with_convert_types in jdbc adapter (jeremyevans)
60
+
61
+ * Deprecate Sequel::IBMDB::Dataset#convert_smallint_to_bool= method (jeremyevans)
62
+
63
+ * Deprecate Sequel::IBMDB.convert_smallint_to_bool accessor (jeremyevans)
64
+
65
+ * Add Database#convert_smallint_to_bool accessor in the ibmdb adapter (jeremyevans)
66
+
67
+ * Deprecate sequel_3_dataset_methods extension (jeremyevans)
68
+
69
+ * Deprecate query_literals extension (jeremyevans)
70
+
71
+ * Deprecate using subtype conversion procs added after registering composite type in the pg_row extension (jeremyevans)
72
+
73
+ * Don't try canceling copy in Database#copy_into if copier is not created yet (aakashAu) (#1384)
74
+
75
+ * Deprecate global conversion procs added by pg_* extensions, when extension isn't loaded into Database instance (jeremyevans)
76
+
77
+ * Deprecate Sequel::Postgres::PGRange.register in the pg_range extension (jeremyevans)
78
+
79
+ * Deprecate Sequel::Postgres::PGArray.register in the pg_array extension (jeremyevans)
80
+
81
+ * Deprecate Database#copy_conversion_procs (private method) on PostgreSQL (jeremyevans)
82
+
83
+ * Deprecate Database#reset_conversion_procs on PostgreSQL (jeremyevans)
84
+
85
+ * Deprecate meta_def extension (jeremyevans)
86
+
87
+ * Make class_table_inheritance plugin with :alias option not use subquery for datasets that don't join (jeremyevans)
88
+
89
+ * Deprecate hash_aliases extension (jeremyevans)
90
+
91
+ * Deprecate filter_having extension (jeremyevans)
92
+
93
+ * Deprecate empty_array_ignore_nulls extension (jeremyevans)
94
+
95
+ * Deprecate Array#sql_array in the core_extensions extension (jeremyevans)
96
+
97
+ * Make validation_helpers plugin :allow_blank option work correctly when the blank extension is not loaded (jeremyevans)
98
+
99
+ * Make validation_class_methods plugin no longer require the blank extension (jeremyevans)
100
+
101
+ * Clear cached associations when touching associations in the touch plugin (jeremyevans)
102
+
103
+ * Make pg_array_associations model plugin load pg_array extension into database (jeremyevans)
104
+
105
+ * Remove support for :strict option in nested_attributes plugin, use :unmatched_pk option instead (jeremyevans)
106
+
107
+ * Make to_json class/dataset method in json_serializer plugin accept :instance_block option to pass block to Model#to_json (jeremyevans)
108
+
109
+ * Make to_json methods in json_serializer plugin accept blocks that are used to transform values before serializing to JSON (jeremyevans)
110
+
111
+ * Make Sequel.object_to_json pass block to #to_json (jeremyevans)
112
+
113
+ * Deprecate identifier_columns plugin, not needed with Sequel.split_symbols = false (jeremyevans)
114
+
115
+ * Make reloading column_conflicts plugin not remove existing conflict markings (jeremyevans)
116
+
117
+ * Deprecate cti_base_model, cti_key, and cti_model_map class methods in class_table_inheritance plugin (jeremyevans)
118
+
119
+ * Make Model.skip_auto_validations(:not_null) in the auto_validations plugin skip not null checks for columns with default values (jeremyevans)
120
+
121
+ * Make Database#copy_into in jdbc/postgresql adapter respect :server option (jeremyevans)
122
+
123
+ * Make #to_hash and #to_hash_groups handle options in the static_cache plugin, and add rename #to_hash to #as_hash (jeremyevans)
124
+
125
+ * Rename Dataset#to_hash to #as_hash, and add #to_hash as an alias, to allow undefing #to_hash to fix ruby calling it implicitly (jeremyevans) (#1375)
126
+
127
+ * Handle PG* constants deprecated in pg 0.21.0 in the postgres adapter (jeremyevans) (#1377, #1378)
128
+
129
+ * Support :association_pks_use_associated_table association option in association_pks plugin (jeremyevans)
130
+
131
+ * Make pg_hstore extension reset hstore conversion proc when running Database#reset_conversion_procs (jeremyevans)
132
+
133
+ * Fix incorrect SQL used for inserting into a CTI subclass sharing the primary table when using the :alias option (jeremyevans)
134
+
1
135
  === 4.47.0 (2017-06-01)
2
136
 
3
137
  * Deprecate pg_typecast_on_load plugin, only useful on deprecated do and swift adapters (jeremyevans)
data/Rakefile CHANGED
@@ -129,7 +129,7 @@ spec_task.call("Run bin/sequel specs", :spec_bin, 'spec/bin_spec.rb', false)
129
129
  spec_task.call("Run core extensions specs", :spec_core_ext, 'spec/core_extensions_spec.rb', true)
130
130
  spec_task.call("Run integration tests", :spec_integration, 'spec/adapter_spec.rb none', true)
131
131
 
132
- %w'postgres sqlite mysql informix oracle firebird mssql db2 sqlanywhere'.each do |adapter|
132
+ %w'postgres sqlite mysql oracle mssql db2 sqlanywhere'.each do |adapter|
133
133
  spec_task.call("Run #{adapter} tests", :"spec_#{adapter}", "spec/adapter_spec.rb #{adapter}", true)
134
134
  end
135
135
 
@@ -0,0 +1,293 @@
1
+ = Deprecated Features
2
+
3
+ * The identifier_columns plugin is now deprecated. There is no reason
4
+ to use it when Sequel.split_symbols = false, which will be the
5
+ default in Sequel 5.
6
+
7
+ * The filter_having, hash_aliases, and sequel_3_dataset_methods
8
+ extensions are now deprecated. They only existed for backwards
9
+ compatibility with Sequel 3.
10
+
11
+ * The query_literals extension is now deprecated. It changes behavior
12
+ in a way that makes SQL injections more likely.
13
+
14
+ * The meta_def extension is now deprecated. It is no longer necessary,
15
+ since on ruby 1.9+ you can use define_singleton_method.
16
+
17
+ * The empty_array_ignore_nulls extension has been deprecated. It
18
+ has been a no-op since Sequel 4.25.0.
19
+
20
+ * The cti_base_model, cti_key, and cti_model_map class methods in
21
+ the class_table_inheritance plugin are now deprecated. Use
22
+ cti_models.first instead of cti_base_model, sti_key
23
+ instead of cti_key, and sti_model_map instead of cti_model_map.
24
+
25
+ * The :strict option in the nested_attributes plugin is now deprecated.
26
+ Switch to using the :unmatched_pk option.
27
+
28
+ * Database#reset_conversion_procs on PostgreSQL is now deprecated.
29
+ There will be no need to call it in Sequel 5.
30
+
31
+ * Using global conversion procs added by the pg_* extensions, without
32
+ loading the pg_* extension into the Database instance, are now
33
+ deprecated. Additionally, using PGArray.register or PGRange.register
34
+ to register global types is now also deprecated. Use
35
+ Database#register_array_type or Database#register_range_type instead
36
+ to register the types on a per-Database basis.
37
+
38
+ * Treating :natural_inner join type as NATURAL LEFT JOIN on MySQL is
39
+ now deprecated. MySQL doesn't support NATURAL INNER JOIN, but if
40
+ you were going to convert it, NATURAL JOIN would make more sense.
41
+
42
+ * Unexpected values passed to Dataset#insert_conflict on SQLite are
43
+ now deprecated. Only values that result in one of the following
44
+ strings will be allowed in Sequel 5: ROLLBACK, ABORT, FAIL, IGNORE,
45
+ and REPLACE.
46
+
47
+ * The Dataset#and, #exclude_where, #interval, and #range methods
48
+ are now deprecated. Undeprecated copies are now available in the
49
+ new sequel_4_dataset_methods extension.
50
+
51
+ * Model.<< is now deprecated. Intuitivately, you would except this
52
+ to call Model.create and return the Model class, but it calls <<
53
+ on the model's dataset and returns the dataset.
54
+
55
+ * The Sequel::Postgres::PG_TYPES constant is now deprecated. All
56
+ conversion procs should now be added on a per-Database basis using
57
+ add_conversion_proc or add_named_conversion_proc. The following
58
+ private Database methods related to conversion procs are now
59
+ deprecated, though some are still called internally and therefore
60
+ do not have deprecation warnings:
61
+
62
+ * add_named_conversion_procs
63
+ * conversion_procs_updated
64
+ * convert_named_procs_to_procs
65
+ * copy_conversion_procs
66
+ * get_conversion_procs
67
+
68
+ Related to this, loading the sequel/adapters/utils/pg_types.rb file
69
+ is now deprecated.
70
+
71
+ * The following adapter or database specific global accessors for setting
72
+ defaults are now deprecated:
73
+
74
+ * Sequel::DB2.use_clob_as_blob
75
+ * Sequel::IBMDB.convert_smallint_to_bool
76
+ * Sequel::MySQL.convert_invalid_date_time
77
+ * Sequel::MySQL.convert_tinyint_to_bool
78
+ * Sequel::MySQL.default_charset
79
+ * Sequel::MySQL.default_collate
80
+ * Sequel::MySQL.default_engine
81
+ * Sequel::Postgres.use_iso_date_format
82
+ * Sequel::Postgres.client_min_messages
83
+ * Sequel::Postgres.force_standard_strings
84
+ * Sequel::SqlAnywhere.convert_smallint_to_bool
85
+
86
+ Use the Database instance accessors or Database options instead to
87
+ change behavior.
88
+
89
+ * The following adapter or database specific dataset mutation methods are
90
+ now deprecated:
91
+
92
+ * convert_smallint_to_bool= (ibmdb adapter, SQLAnywhere)
93
+ * convert_types= (jdbc adapter)
94
+ * mssql_unicode_strings= (Microsoft SQL Server)
95
+
96
+ Use the with_* methods which return a modified copy of the dataset
97
+ instead of these mutation methods.
98
+
99
+ * The Dataset#non_sql_options private method is now deprecated.
100
+ External adapters that overrode this method should switch to
101
+ overriding Dataset#non_sql_option?.
102
+
103
+ * The Database#timestamp_convertor private method in the jdbc adapter
104
+ is now deprecated. Users should switch to method(:timestamp_convert).
105
+
106
+ * Modification of the Sequel::JDBC::TypeConvertor class is now
107
+ deprecated. External jdbc subadapters that were using this to add
108
+ custom conversion procs should be modified.
109
+
110
+ * Having the pg_row extension respect conversion procs for subtypes
111
+ added after the registeration of the composite type is now deprecated.
112
+ Now, all subtypes should have the appropriate conversion proc added
113
+ before the composite type is registered.
114
+
115
+ * Array#sql_array in the core_extensions extension is now deprecated.
116
+ Switch to using Array#sql_value_list.
117
+
118
+ * The SEQUEL_POSTGRES_USES_PG constant added by the postgres adapter
119
+ is now deprecated. Sequel::Postgres::USES_PG should be used instead.
120
+
121
+ * Many more internal Sequel constants have been deprecated.
122
+
123
+ = New Features
124
+
125
+ * The Model#to_json and Dataset#to_json methods in the json_serializer
126
+ plugin now support a block. This block is called with the
127
+ hash/array that would have be serialized to JSON, and the block
128
+ should return the object to serialize. This makes it easy to
129
+ customize the JSON output by adding new entries, or wrapping the
130
+ object in other object.
131
+
132
+ The Dataset#to_json method supports an :instance_block option, which
133
+ should be a proc that will be passed to Model#to_json.
134
+
135
+ In order to implement this, Sequel.object_to_json now passes any
136
+ block given to the to_json call on the object. If you are
137
+ overriding Sequel.object_to_json, you are responsible for making
138
+ sure the block is passed appropriately.
139
+
140
+ * The association_pks plugin now supports a
141
+ :association_pks_use_associated_table association option for
142
+ many_to_many associations. If this option is used, instead of just
143
+ looking at the join table, the association_pks getter will get the
144
+ primary keys from the associated table. This can be useful if the
145
+ association's right_primary_key does not match the associated
146
+ model's primary key, and you are interested in the primary keys of
147
+ the associated objects. If this option is used, no association_pks
148
+ setter method is created.
149
+
150
+ * Dataset#as_hash has been added as a replacement to #to_hash.
151
+ If you want, you can now undef_method :to_hash and use
152
+ as_hash and things will work. Doing so can work around
153
+ problems when using keyword argument splats in ruby 2.0+.
154
+ For example:
155
+
156
+ def foo(*a, **b)
157
+ end
158
+
159
+ foo(City.order(:id))
160
+
161
+ results in foo being called with a being [] and b being
162
+ City.order(:id).to_hash, which is unexpected and undesired
163
+ behavior. If you want to use keyword argument splats or other
164
+ places where ruby will call to_hash implicitly if it is defined,
165
+ using undef_method :to_hash is recommended.
166
+
167
+ * A Database#add_conversion_proc method has been added on
168
+ PostgreSQL. This method takes a type OID and either a block
169
+ or a callable argument to use as the conversion proc for the
170
+ type OID.
171
+
172
+ * The following adapter or database specific Database accessors
173
+ have been added for changing settings on a per-Database basis:
174
+
175
+ * convert_smallint_to_bool (ibmdb adapter)
176
+ * default_charset (MySQL)
177
+ * default_collate (MySQL)
178
+ * default_engine (MySQL)
179
+ * use_clob_as_blob (DB2)
180
+
181
+ * A Dataset#with_convert_types method has been added to the jdbc
182
+ adapter, for returning a modified dataset with the convert_types
183
+ setting changed.
184
+
185
+ = Other Improvements
186
+
187
+ * Using the postgres adapter with pg 0.21.0 no longer results in
188
+ deprecation warnings.
189
+
190
+ * When using the class_table_inheritance plugin and using a direct
191
+ subclass of the parent class that does not use a separate table,
192
+ as well as using the :alias option, the insert SQL used is now
193
+ correct. Previously, it attempted to insert into a subquery,
194
+ which is not valid SQL.
195
+
196
+ Additionally, the dataset for such a model no longer uses a
197
+ subquery, since there is no reason to do so as there is no join.
198
+
199
+ * Model.skip_auto_validations(:not_null) in the auto_validations
200
+ plugin now skips not null checks for columns with default
201
+ values, in addition to skipping not null checks for columns
202
+ without default values.
203
+
204
+ * The static_cache plugin now supports the options hash argument
205
+ to to_hash and to_hash_groups. Currently, it only supports
206
+ the :hash option, since the :all option doesn't make sense.
207
+
208
+ * When touching associations in the touch plugin, clear the
209
+ cached association, because otherwise the cached values will
210
+ be stale.
211
+
212
+ * The validation_class_methods plugin no longer requires the
213
+ blank extension.
214
+
215
+ * The validation_helpers plugin methods that support the
216
+ :allow_blank option now work correctly if the blank extension
217
+ is not loaded.
218
+
219
+ * Loading the column_conflicts plugin into a model a second time
220
+ no longer removes existing column conflict settings.
221
+
222
+ * On SQLite 3.8.8+, indexes automatically created from unique
223
+ constraints are now included in Database#indexes output.
224
+
225
+ * On SQLite 3.8.8+, partial indexes are now excluded from
226
+ Database#indexes output.
227
+
228
+ * Database#indexes on PostgreSQL 9.5+ now uses a simpler query
229
+ with the array_position function.
230
+
231
+ * Database#foreign_key_list on PostgreSQL now uses a single
232
+ query instead of two queries, and also uses the array_position
233
+ function on PostgreSQL 9.5+ to simplify the queries.
234
+
235
+ * On PostgreSQL and Derby, when calling Database#create_table
236
+ with the :ignore_index_errors option inside a transaction,
237
+ a savepoint is used around each index creation so that an
238
+ index error does not cause the entire transaction to fail.
239
+ A savepoint is also used on Microsoft SQL Server, but it
240
+ appears that Microsoft SQL Server rolls back the entire
241
+ transaction if CREATE INDEX returns an error, instead of
242
+ just rolling back to the savepoint.
243
+
244
+ * Encoding is now preserved when parsing PostgreSQL arrays in the
245
+ pg_array extension.
246
+
247
+ * Database#copy_table in the postgres adapter now does not
248
+ hide the underlying exception if an exception is raised
249
+ during processing.
250
+
251
+ * Database#copy_into in the jdbc/postgresql adapter now does not
252
+ hide the underlying exception if an exception is raised
253
+ during processing.
254
+
255
+ * Database#copy_into in the jdbc/postgresql adapter now
256
+ respects the :server option for using a specific shard.
257
+
258
+ * Calling #reset_conversion_procs on Database instance that
259
+ uses the pg_hstore extension now results in the hstore
260
+ type still being parsed. Previously, the hstore conversion
261
+ proc would be dropped.
262
+
263
+ * The postgres adapter no longer monkey-patches postgres-pr if it
264
+ uses that as the driver.
265
+
266
+ * Multiple thread-safety issues in the mock adapter have been
267
+ fixed.
268
+
269
+ * Thread safety issues when simultaneously loading multiple
270
+ adapters that access PostgreSQL have been fixed.
271
+
272
+ * Hash allocations have been reduced in the csv_serializer,
273
+ json_serializer, and xml_serializer plugins.
274
+
275
+ * The deprecated Sequel::Model::ANONYMOUS_MODEL_CLASSES
276
+ constant is now correctly populated with classes created
277
+ by Sequel::Model(). This was broken in starting in
278
+ Sequel 4.45.0.
279
+
280
+ = Backwards Compatibility
281
+
282
+ * The pg_array_associations plugin now loads the pg_array
283
+ extension into the Database instance if it is not already
284
+ loaded. This can break cases where the pg_array_associations
285
+ plugin is used on a non-PostgreSQL database.
286
+
287
+ * Support for using the old postgres driver has been removed
288
+ from the postgres adapter. The postgres adapter now only
289
+ supports pg and postgres-pr.
290
+
291
+ * When the postgres-pr driver is being used by the postgres
292
+ adapter, connecting to a database is only allowed if
293
+ standard strings are being forced (the default).