sequel 4.30.0 → 4.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +18 -0
  3. data/MIT-LICENSE +1 -1
  4. data/bin/sequel +1 -0
  5. data/doc/opening_databases.rdoc +6 -0
  6. data/doc/release_notes/4.31.0.txt +57 -0
  7. data/lib/sequel.rb +2 -0
  8. data/lib/sequel/adapters/ado.rb +2 -0
  9. data/lib/sequel/adapters/ado/access.rb +2 -0
  10. data/lib/sequel/adapters/ado/mssql.rb +2 -0
  11. data/lib/sequel/adapters/amalgalite.rb +2 -0
  12. data/lib/sequel/adapters/cubrid.rb +2 -0
  13. data/lib/sequel/adapters/do.rb +2 -0
  14. data/lib/sequel/adapters/do/mysql.rb +2 -0
  15. data/lib/sequel/adapters/do/postgres.rb +2 -0
  16. data/lib/sequel/adapters/do/sqlite3.rb +2 -0
  17. data/lib/sequel/adapters/ibmdb.rb +3 -1
  18. data/lib/sequel/adapters/jdbc.rb +2 -0
  19. data/lib/sequel/adapters/jdbc/as400.rb +2 -0
  20. data/lib/sequel/adapters/jdbc/cubrid.rb +2 -0
  21. data/lib/sequel/adapters/jdbc/db2.rb +2 -0
  22. data/lib/sequel/adapters/jdbc/derby.rb +2 -0
  23. data/lib/sequel/adapters/jdbc/firebirdsql.rb +2 -0
  24. data/lib/sequel/adapters/jdbc/h2.rb +2 -0
  25. data/lib/sequel/adapters/jdbc/hsqldb.rb +2 -0
  26. data/lib/sequel/adapters/jdbc/informix-sqli.rb +2 -0
  27. data/lib/sequel/adapters/jdbc/jdbcprogress.rb +2 -0
  28. data/lib/sequel/adapters/jdbc/jtds.rb +2 -0
  29. data/lib/sequel/adapters/jdbc/mssql.rb +2 -0
  30. data/lib/sequel/adapters/jdbc/mysql.rb +2 -0
  31. data/lib/sequel/adapters/jdbc/oracle.rb +2 -0
  32. data/lib/sequel/adapters/jdbc/postgresql.rb +24 -1
  33. data/lib/sequel/adapters/jdbc/sqlanywhere.rb +2 -0
  34. data/lib/sequel/adapters/jdbc/sqlite.rb +2 -0
  35. data/lib/sequel/adapters/jdbc/sqlserver.rb +2 -0
  36. data/lib/sequel/adapters/jdbc/transactions.rb +2 -0
  37. data/lib/sequel/adapters/mock.rb +2 -0
  38. data/lib/sequel/adapters/mysql.rb +2 -0
  39. data/lib/sequel/adapters/mysql2.rb +2 -0
  40. data/lib/sequel/adapters/odbc.rb +2 -0
  41. data/lib/sequel/adapters/odbc/db2.rb +2 -0
  42. data/lib/sequel/adapters/odbc/mssql.rb +2 -0
  43. data/lib/sequel/adapters/odbc/progress.rb +2 -0
  44. data/lib/sequel/adapters/oracle.rb +4 -2
  45. data/lib/sequel/adapters/postgres.rb +5 -3
  46. data/lib/sequel/adapters/postgresql.rb +2 -0
  47. data/lib/sequel/adapters/shared/access.rb +2 -0
  48. data/lib/sequel/adapters/shared/cubrid.rb +2 -0
  49. data/lib/sequel/adapters/shared/db2.rb +2 -0
  50. data/lib/sequel/adapters/shared/firebird.rb +2 -0
  51. data/lib/sequel/adapters/shared/informix.rb +2 -0
  52. data/lib/sequel/adapters/shared/mssql.rb +2 -0
  53. data/lib/sequel/adapters/shared/mysql.rb +5 -1
  54. data/lib/sequel/adapters/shared/mysql_prepared_statements.rb +2 -0
  55. data/lib/sequel/adapters/shared/oracle.rb +5 -3
  56. data/lib/sequel/adapters/shared/postgres.rb +19 -12
  57. data/lib/sequel/adapters/shared/progress.rb +2 -0
  58. data/lib/sequel/adapters/shared/sqlanywhere.rb +3 -1
  59. data/lib/sequel/adapters/shared/sqlite.rb +2 -0
  60. data/lib/sequel/adapters/sqlanywhere.rb +2 -0
  61. data/lib/sequel/adapters/sqlite.rb +4 -1
  62. data/lib/sequel/adapters/swift.rb +2 -0
  63. data/lib/sequel/adapters/swift/mysql.rb +2 -0
  64. data/lib/sequel/adapters/swift/postgres.rb +2 -0
  65. data/lib/sequel/adapters/swift/sqlite.rb +2 -0
  66. data/lib/sequel/adapters/tinytds.rb +2 -0
  67. data/lib/sequel/adapters/utils/emulate_offset_with_reverse_and_count.rb +5 -3
  68. data/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +5 -3
  69. data/lib/sequel/adapters/utils/pg_types.rb +2 -0
  70. data/lib/sequel/adapters/utils/replace.rb +2 -0
  71. data/lib/sequel/adapters/utils/split_alter_table.rb +2 -0
  72. data/lib/sequel/adapters/utils/stored_procedures.rb +2 -0
  73. data/lib/sequel/ast_transformer.rb +2 -0
  74. data/lib/sequel/connection_pool.rb +2 -0
  75. data/lib/sequel/connection_pool/sharded_single.rb +2 -0
  76. data/lib/sequel/connection_pool/sharded_threaded.rb +2 -0
  77. data/lib/sequel/connection_pool/single.rb +2 -0
  78. data/lib/sequel/connection_pool/threaded.rb +2 -0
  79. data/lib/sequel/core.rb +2 -0
  80. data/lib/sequel/database.rb +2 -0
  81. data/lib/sequel/database/connecting.rb +2 -0
  82. data/lib/sequel/database/dataset.rb +2 -0
  83. data/lib/sequel/database/dataset_defaults.rb +2 -0
  84. data/lib/sequel/database/features.rb +2 -0
  85. data/lib/sequel/database/logging.rb +2 -0
  86. data/lib/sequel/database/misc.rb +2 -0
  87. data/lib/sequel/database/query.rb +2 -0
  88. data/lib/sequel/database/schema_generator.rb +2 -0
  89. data/lib/sequel/database/schema_methods.rb +11 -4
  90. data/lib/sequel/database/transactions.rb +2 -0
  91. data/lib/sequel/dataset.rb +2 -0
  92. data/lib/sequel/dataset/actions.rb +2 -0
  93. data/lib/sequel/dataset/features.rb +2 -0
  94. data/lib/sequel/dataset/graph.rb +2 -0
  95. data/lib/sequel/dataset/misc.rb +2 -0
  96. data/lib/sequel/dataset/mutation.rb +2 -0
  97. data/lib/sequel/dataset/placeholder_literalizer.rb +3 -1
  98. data/lib/sequel/dataset/prepared_statements.rb +2 -0
  99. data/lib/sequel/dataset/query.rb +2 -0
  100. data/lib/sequel/dataset/sql.rb +7 -5
  101. data/lib/sequel/deprecated.rb +2 -0
  102. data/lib/sequel/exceptions.rb +2 -0
  103. data/lib/sequel/extensions/_pretty_table.rb +5 -3
  104. data/lib/sequel/extensions/arbitrary_servers.rb +2 -0
  105. data/lib/sequel/extensions/blank.rb +2 -0
  106. data/lib/sequel/extensions/columns_introspection.rb +2 -0
  107. data/lib/sequel/extensions/connection_validator.rb +2 -0
  108. data/lib/sequel/extensions/constraint_validations.rb +2 -0
  109. data/lib/sequel/extensions/core_extensions.rb +2 -0
  110. data/lib/sequel/extensions/core_refinements.rb +2 -0
  111. data/lib/sequel/extensions/current_datetime_timestamp.rb +2 -0
  112. data/lib/sequel/extensions/dataset_source_alias.rb +2 -0
  113. data/lib/sequel/extensions/date_arithmetic.rb +3 -1
  114. data/lib/sequel/extensions/empty_array_consider_nulls.rb +2 -0
  115. data/lib/sequel/extensions/empty_array_ignore_nulls.rb +2 -0
  116. data/lib/sequel/extensions/error_sql.rb +2 -0
  117. data/lib/sequel/extensions/eval_inspect.rb +2 -0
  118. data/lib/sequel/extensions/filter_having.rb +2 -0
  119. data/lib/sequel/extensions/from_block.rb +2 -0
  120. data/lib/sequel/extensions/graph_each.rb +2 -0
  121. data/lib/sequel/extensions/hash_aliases.rb +2 -0
  122. data/lib/sequel/extensions/inflector.rb +2 -0
  123. data/lib/sequel/extensions/looser_typecasting.rb +2 -0
  124. data/lib/sequel/extensions/meta_def.rb +2 -0
  125. data/lib/sequel/extensions/migration.rb +14 -4
  126. data/lib/sequel/extensions/mssql_emulate_lateral_with_apply.rb +2 -0
  127. data/lib/sequel/extensions/named_timezones.rb +2 -0
  128. data/lib/sequel/extensions/null_dataset.rb +2 -0
  129. data/lib/sequel/extensions/pagination.rb +2 -0
  130. data/lib/sequel/extensions/pg_array.rb +16 -36
  131. data/lib/sequel/extensions/pg_array_ops.rb +2 -0
  132. data/lib/sequel/extensions/pg_enum.rb +4 -1
  133. data/lib/sequel/extensions/pg_hstore.rb +3 -1
  134. data/lib/sequel/extensions/pg_hstore_ops.rb +2 -0
  135. data/lib/sequel/extensions/pg_inet.rb +2 -0
  136. data/lib/sequel/extensions/pg_inet_ops.rb +2 -0
  137. data/lib/sequel/extensions/pg_interval.rb +3 -1
  138. data/lib/sequel/extensions/pg_json.rb +2 -0
  139. data/lib/sequel/extensions/pg_json_ops.rb +2 -0
  140. data/lib/sequel/extensions/pg_loose_count.rb +2 -0
  141. data/lib/sequel/extensions/pg_range.rb +2 -0
  142. data/lib/sequel/extensions/pg_range_ops.rb +2 -0
  143. data/lib/sequel/extensions/pg_row.rb +2 -0
  144. data/lib/sequel/extensions/pg_row_ops.rb +2 -0
  145. data/lib/sequel/extensions/pg_static_cache_updater.rb +2 -0
  146. data/lib/sequel/extensions/pretty_table.rb +2 -0
  147. data/lib/sequel/extensions/query.rb +2 -0
  148. data/lib/sequel/extensions/query_literals.rb +2 -0
  149. data/lib/sequel/extensions/round_timestamps.rb +2 -0
  150. data/lib/sequel/extensions/ruby18_symbol_extensions.rb +2 -0
  151. data/lib/sequel/extensions/schema_caching.rb +2 -0
  152. data/lib/sequel/extensions/schema_dumper.rb +4 -1
  153. data/lib/sequel/extensions/select_remove.rb +2 -0
  154. data/lib/sequel/extensions/sequel_3_dataset_methods.rb +3 -1
  155. data/lib/sequel/extensions/server_block.rb +2 -0
  156. data/lib/sequel/extensions/set_overrides.rb +2 -0
  157. data/lib/sequel/extensions/split_array_nil.rb +2 -0
  158. data/lib/sequel/extensions/sql_expr.rb +2 -0
  159. data/lib/sequel/extensions/string_date_time.rb +2 -0
  160. data/lib/sequel/extensions/thread_local_timezones.rb +2 -0
  161. data/lib/sequel/extensions/to_dot.rb +3 -1
  162. data/lib/sequel/model.rb +2 -0
  163. data/lib/sequel/model/associations.rb +3 -1
  164. data/lib/sequel/model/base.rb +5 -1
  165. data/lib/sequel/model/dataset_module.rb +2 -0
  166. data/lib/sequel/model/default_inflections.rb +2 -0
  167. data/lib/sequel/model/errors.rb +2 -0
  168. data/lib/sequel/model/exceptions.rb +2 -0
  169. data/lib/sequel/model/inflections.rb +2 -0
  170. data/lib/sequel/model/plugins.rb +2 -0
  171. data/lib/sequel/no_core_ext.rb +2 -0
  172. data/lib/sequel/plugins/accessed_columns.rb +2 -0
  173. data/lib/sequel/plugins/active_model.rb +2 -0
  174. data/lib/sequel/plugins/after_initialize.rb +2 -0
  175. data/lib/sequel/plugins/association_autoreloading.rb +2 -0
  176. data/lib/sequel/plugins/association_dependencies.rb +2 -0
  177. data/lib/sequel/plugins/association_pks.rb +20 -24
  178. data/lib/sequel/plugins/association_proxies.rb +2 -0
  179. data/lib/sequel/plugins/auto_validations.rb +2 -0
  180. data/lib/sequel/plugins/before_after_save.rb +2 -0
  181. data/lib/sequel/plugins/blacklist_security.rb +2 -0
  182. data/lib/sequel/plugins/boolean_readers.rb +2 -0
  183. data/lib/sequel/plugins/boolean_subsets.rb +2 -0
  184. data/lib/sequel/plugins/caching.rb +2 -0
  185. data/lib/sequel/plugins/class_table_inheritance.rb +2 -0
  186. data/lib/sequel/plugins/column_conflicts.rb +2 -0
  187. data/lib/sequel/plugins/column_select.rb +2 -0
  188. data/lib/sequel/plugins/composition.rb +2 -0
  189. data/lib/sequel/plugins/constraint_validations.rb +2 -0
  190. data/lib/sequel/plugins/csv_serializer.rb +2 -0
  191. data/lib/sequel/plugins/dataset_associations.rb +2 -0
  192. data/lib/sequel/plugins/defaults_setter.rb +2 -0
  193. data/lib/sequel/plugins/delay_add_association.rb +2 -0
  194. data/lib/sequel/plugins/dirty.rb +2 -0
  195. data/lib/sequel/plugins/eager_each.rb +2 -0
  196. data/lib/sequel/plugins/error_splitter.rb +2 -0
  197. data/lib/sequel/plugins/force_encoding.rb +2 -0
  198. data/lib/sequel/plugins/hook_class_methods.rb +2 -0
  199. data/lib/sequel/plugins/identifier_columns.rb +2 -0
  200. data/lib/sequel/plugins/input_transformer.rb +2 -0
  201. data/lib/sequel/plugins/insert_returning_select.rb +2 -0
  202. data/lib/sequel/plugins/instance_filters.rb +2 -0
  203. data/lib/sequel/plugins/instance_hooks.rb +2 -0
  204. data/lib/sequel/plugins/inverted_subsets.rb +2 -0
  205. data/lib/sequel/plugins/json_serializer.rb +2 -0
  206. data/lib/sequel/plugins/lazy_attributes.rb +2 -0
  207. data/lib/sequel/plugins/list.rb +2 -0
  208. data/lib/sequel/plugins/many_through_many.rb +2 -0
  209. data/lib/sequel/plugins/many_to_one_pk_lookup.rb +2 -0
  210. data/lib/sequel/plugins/modification_detection.rb +2 -0
  211. data/lib/sequel/plugins/mssql_optimistic_locking.rb +2 -0
  212. data/lib/sequel/plugins/nested_attributes.rb +2 -0
  213. data/lib/sequel/plugins/optimistic_locking.rb +2 -0
  214. data/lib/sequel/plugins/pg_array_associations.rb +2 -0
  215. data/lib/sequel/plugins/pg_row.rb +2 -0
  216. data/lib/sequel/plugins/pg_typecast_on_load.rb +2 -0
  217. data/lib/sequel/plugins/prepared_statements.rb +2 -0
  218. data/lib/sequel/plugins/prepared_statements_associations.rb +2 -0
  219. data/lib/sequel/plugins/prepared_statements_safe.rb +2 -0
  220. data/lib/sequel/plugins/prepared_statements_with_pk.rb +2 -0
  221. data/lib/sequel/plugins/rcte_tree.rb +2 -0
  222. data/lib/sequel/plugins/schema.rb +2 -0
  223. data/lib/sequel/plugins/scissors.rb +2 -0
  224. data/lib/sequel/plugins/serialization.rb +2 -0
  225. data/lib/sequel/plugins/serialization_modification_detection.rb +2 -0
  226. data/lib/sequel/plugins/sharding.rb +2 -0
  227. data/lib/sequel/plugins/single_table_inheritance.rb +2 -0
  228. data/lib/sequel/plugins/singular_table_names.rb +2 -0
  229. data/lib/sequel/plugins/skip_create_refresh.rb +2 -0
  230. data/lib/sequel/plugins/split_values.rb +2 -0
  231. data/lib/sequel/plugins/static_cache.rb +2 -0
  232. data/lib/sequel/plugins/string_stripper.rb +2 -0
  233. data/lib/sequel/plugins/subclasses.rb +2 -0
  234. data/lib/sequel/plugins/subset_conditions.rb +2 -0
  235. data/lib/sequel/plugins/table_select.rb +2 -0
  236. data/lib/sequel/plugins/tactical_eager_loading.rb +2 -0
  237. data/lib/sequel/plugins/timestamps.rb +2 -0
  238. data/lib/sequel/plugins/touch.rb +2 -0
  239. data/lib/sequel/plugins/tree.rb +2 -0
  240. data/lib/sequel/plugins/typecast_on_load.rb +2 -0
  241. data/lib/sequel/plugins/unlimited_update.rb +2 -0
  242. data/lib/sequel/plugins/update_or_create.rb +2 -0
  243. data/lib/sequel/plugins/update_primary_key.rb +2 -0
  244. data/lib/sequel/plugins/update_refresh.rb +2 -0
  245. data/lib/sequel/plugins/uuid.rb +2 -0
  246. data/lib/sequel/plugins/validate_associated.rb +2 -0
  247. data/lib/sequel/plugins/validation_class_methods.rb +2 -0
  248. data/lib/sequel/plugins/validation_helpers.rb +3 -1
  249. data/lib/sequel/plugins/xml_serializer.rb +2 -0
  250. data/lib/sequel/sql.rb +3 -1
  251. data/lib/sequel/timezones.rb +2 -0
  252. data/lib/sequel/version.rb +3 -1
  253. data/spec/adapters/mysql_spec.rb +4 -0
  254. data/spec/adapters/postgres_spec.rb +35 -11
  255. data/spec/core/connection_pool_spec.rb +1 -1
  256. data/spec/extensions/association_pks_spec.rb +4 -2
  257. data/spec/extensions/caching_spec.rb +1 -1
  258. data/spec/extensions/csv_serializer_spec.rb +7 -0
  259. data/spec/extensions/date_arithmetic_spec.rb +1 -1
  260. data/spec/extensions/dirty_spec.rb +6 -6
  261. data/spec/extensions/force_encoding_spec.rb +12 -12
  262. data/spec/extensions/input_transformer_spec.rb +1 -1
  263. data/spec/extensions/migration_spec.rb +16 -0
  264. data/spec/extensions/modification_detection_spec.rb +2 -2
  265. data/spec/extensions/nested_attributes_spec.rb +1 -1
  266. data/spec/extensions/optimistic_locking_spec.rb +1 -1
  267. data/spec/extensions/pg_array_spec.rb +3 -8
  268. data/spec/files/double_migration/001_create_sessions.rb +9 -0
  269. data/spec/files/double_migration/002_create_nodes.rb +19 -0
  270. data/spec/files/double_migration/003_3_create_users.rb +4 -0
  271. data/spec/files/empty_migration/001_create_sessions.rb +9 -0
  272. data/spec/files/empty_migration/002_create_nodes.rb +0 -0
  273. data/spec/files/empty_migration/003_3_create_users.rb +4 -0
  274. metadata +11 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe7b61c71980b22f3aa98f3815a5852d11e0880d
4
- data.tar.gz: f7b80005c8ad61d472e8f011e3532eb72c40f74b
3
+ metadata.gz: 7388e21a31fdf29fda8d3687cdf96011514b32f3
4
+ data.tar.gz: ea540316de1e370e88ad2c15bc2b53860f34f353
5
5
  SHA512:
6
- metadata.gz: fe4a59d1e06d7f5267ff9f1201b052b06717e24b8d86b99db3cdfc0187b9056cf7bee88fae1da62a15215046c6babbce17aa97382269354941f6822eba4ba87e
7
- data.tar.gz: 0750aa6e4143b4a074630060cef6033852930be6ab448f6d5a330b502f92bb7cbe86c26dd4d69c10356524c4a02a299becec6982077c5260f7bba329b81bd54d
6
+ metadata.gz: a674f18f2fe56030b484cddbd66e10fa221256609a6314d3f95f606dcd3092d39b96b41368eff9943f95094c7ef8702e1094fcf4d059a7fd3fee2cda8e1eb0de
7
+ data.tar.gz: 2ba7e438b33bf0601ac63eceaaf1858a91437bf4c35f4c95bd16c9a04e7fe990f975ed395b49d1ec4a42b56fe8a90506e74964421027aa3973105cccc3aa32e6
data/CHANGELOG CHANGED
@@ -1,3 +1,21 @@
1
+ === 4.31.0 (2016-02-01)
2
+
3
+ * Convert types in association_pks setters before saving them, instead of just before running queries (jeremyevans)
4
+
5
+ * Use getField and getOID instead of field and oid in the jdbc/postgresql adapter to work around JRuby 9.0.5.0 regression (jeremyevans) (#1137)
6
+
7
+ * Support using PostgreSQL-specific types in bound variables in the jdbc/postgresql adapter (jeremyevans)
8
+
9
+ * Add support for running with --enable-frozen-string-literal on ruby 2.3 (jeremyevans)
10
+
11
+ * Make Database#disconnect in the oracle adapter work correctly on newer versions of oci8 (jeremyevans)
12
+
13
+ * Support parsing PostgreSQL arrays with explicit bounds (jeremyevans) (#1131)
14
+
15
+ * Raise an error if attempting to use a migration file not containing a single migration (jeremyevans) (#1127)
16
+
17
+ * Automatically set referenced key for self referential foriegn key constraint for simple non-autoincrementing primary key on MySQL (jeremyevans) (#1126)
18
+
1
19
  === 4.30.0 (2016-01-04)
2
20
 
3
21
  * Add Dataset#insert_conflict and #insert_ignore on SQLite for handling uniqueness violations (Sharpie) (#1121)
@@ -1,5 +1,5 @@
1
1
  Copyright (c) 2007-2008 Sharon Rosner
2
- Copyright (c) 2008-2015 Jeremy Evans
2
+ Copyright (c) 2008-2016 Jeremy Evans
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to
data/bin/sequel CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen-string-literal: true
2
3
 
3
4
  require 'rubygems'
4
5
  require 'optparse'
@@ -240,6 +240,12 @@ The following additional options are supported:
240
240
  return a connection.
241
241
  :login_timeout :: Set the login timeout on the JDBC connection (in seconds).
242
242
 
243
+ There are a few issues with specific jdbc drivers:
244
+
245
+ jdbc-h2 :: jdbc-h2 versions greater than 1.3.175 have issues with ORDER BY not working correctly in some cases.
246
+ jdbc-postgres :: jdbc-postgres 9.4.1204 has issues using PostgreSQL-specific types in bound variables.
247
+ Use jdbc-postgres 9.4.1200 or below.
248
+
243
249
  === mysql
244
250
 
245
251
  Requires: mysqlplus (or mysql if mysqlplus is not available)
@@ -0,0 +1,57 @@
1
+ = Improvements
2
+
3
+ * Sequel now works with ruby 2.3's --enable-frozen-string-literal,
4
+ and all of the library files are set to use frozen string
5
+ literals by default.
6
+
7
+ A couple adapters and extensions depend on libraries that have
8
+ issues with frozen string literals. Pull requests have been sent
9
+ to each of those dependencies.
10
+
11
+ * The migrators will now raise an exception if a migration file
12
+ contains no migrations or more than one migration.
13
+
14
+ * The jdbc/postgresql adapter now supports using PostgreSQL specific
15
+ types in bound variables. Note that the current version of
16
+ jdbc-postgres (9.4.1204) has regressions that affect this, users
17
+ who need this support should stick with jdbc-postgres 9.4.1200 or
18
+ below.
19
+
20
+ * The jdbc/postgresql adapter now works around a regression in Java
21
+ method lookup in JRuby 9.0.5.0
22
+
23
+ * The setter methods added by the association_pks plugin now do type
24
+ casting immediately, instead of right before the data will be used.
25
+ This makes them more similar to column setter methods, and ensures
26
+ that future calls to the getters that use cached values will
27
+ return correctly typecast data.
28
+
29
+ * The PostgreSQL array parser in the pg_array extension now handles
30
+ arrays with explicit bounds. The explicit bounds are ignored, so
31
+ such values do not round trip, and there is currently no support for
32
+ creating arrays with explicit bounds.
33
+
34
+ * Creating a table with a simple non-incrementing primary key and a
35
+ self-referential foreign key now works correctly on MySQL:
36
+
37
+ DB.create_table!(:table) do
38
+ Integer :id, :primary_key=>true
39
+ foreign_key :fk, :table
40
+ end
41
+
42
+ * Database#disconnect in the oracle adapter now works correctly on
43
+ more recent versions of oci8 where #logoff can raise OCIException
44
+ instead of OCIInvalidHandle.
45
+
46
+ = Backwards Compatibility
47
+
48
+ * The pg_array extension no longer defines
49
+ Sequel::Postgres::PGArray::JSONCreator. This should only affect
50
+ backwards compatibility if you were accessing the constant directly.
51
+ The :parser option to Sequel::Postgres::PGArray.register is also no
52
+ longer respected, but that should not affect backwards compatibility.
53
+
54
+ * The Sequel::Model#convert_cpk_array private method that was added by
55
+ the association_pks plugin has been removed.
56
+ Sequel::Model#convert_pk_array handles both simple and composite
57
+ primary keys now.
@@ -1 +1,3 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'sequel/model'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'win32ole'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/access'
2
4
  Sequel.require 'adapters/utils/split_alter_table'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/mssql'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'amalgalite'
2
4
  Sequel.require 'adapters/shared/sqlite'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'cubrid'
2
4
  Sequel.require 'adapters/shared/cubrid'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'data_objects'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::DataObjects.load_driver 'do_mysql'
2
4
  Sequel.require 'adapters/shared/mysql'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::DataObjects.load_driver 'do_postgres'
2
4
  Sequel.require 'adapters/shared/postgres'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::DataObjects.load_driver 'do_sqlite3'
2
4
  Sequel.require 'adapters/shared/sqlite'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'ibm_db'
2
4
  Sequel.require 'adapters/shared/db2'
3
5
 
@@ -245,7 +247,7 @@ module Sequel
245
247
  args = args.map{|v| v.nil? ? nil : prepared_statement_arg(v)}
246
248
  log_sql = "EXECUTE #{ps_name}"
247
249
  if ps.log_sql
248
- log_sql << " ("
250
+ log_sql += " ("
249
251
  log_sql << sql
250
252
  log_sql << ")"
251
253
  end
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'java'
2
4
  Sequel.require 'adapters/utils/stored_procedures'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.ibm.as400.access.AS400JDBCDriver')
2
4
  Sequel.require 'adapters/jdbc/transactions'
3
5
  Sequel.require 'adapters/utils/emulate_offset_with_row_number'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('Java::cubrid.jdbc.driver.CUBRIDDriver')
2
4
  Sequel.require 'adapters/shared/cubrid'
3
5
  Sequel.require 'adapters/jdbc/transactions'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.ibm.db2.jcc.DB2Driver')
2
4
  Sequel.require 'adapters/shared/db2'
3
5
  Sequel.require 'adapters/jdbc/transactions'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.apache.derby.jdbc.EmbeddedDriver', :Derby)
2
4
  Sequel.require 'adapters/jdbc/transactions'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.firebirdsql.jdbc.FBDriver')
2
4
  Sequel.require 'adapters/shared/firebird'
3
5
  Sequel.require 'adapters/jdbc/transactions'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.h2.Driver', :H2)
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.hsqldb.jdbcDriver', :HSQLDB)
2
4
  Sequel.require 'adapters/jdbc/transactions'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.informix.jdbc.IfxDriver')
2
4
  Sequel.require 'adapters/shared/informix'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.progress.sql.jdbc.JdbcProgressDriver')
2
4
  Sequel.require 'adapters/shared/progress'
3
5
  Sequel.require 'adapters/jdbc/transactions'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('Java::net.sourceforge.jtds.jdbc.Driver', :JTDS)
2
4
  Sequel.require 'adapters/jdbc/mssql'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/mssql'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.mysql.jdbc.Driver', :MySQL)
2
4
  Sequel.require 'adapters/shared/mysql'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('Java::oracle.jdbc.driver.OracleDriver')
2
4
  Sequel.require 'adapters/shared/oracle'
3
5
  Sequel.require 'adapters/jdbc/transactions'
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.postgresql.Driver', :Postgres)
2
4
  Sequel.require 'adapters/shared/postgres'
3
5
 
@@ -138,6 +140,27 @@ module Sequel
138
140
  super || exception.message =~ /\A(This connection has been closed\.|FATAL: terminating connection due to administrator command|An I\/O error occurred while sending to the backend\.)\z/
139
141
  end
140
142
 
143
+ # For PostgreSQL-specific types, return the string that should be used
144
+ # as the PGObject value. Returns nil by default, loading pg_* extensions
145
+ # will override this to add support for specific types.
146
+ def bound_variable_arg(arg, conn)
147
+ nil
148
+ end
149
+
150
+ # If the given argument is a recognized PostgreSQL-specific type, create
151
+ # a PGObject instance with unknown type and the bound argument string value,
152
+ # and set that as the prepared statement argument.
153
+ def set_ps_arg(cps, arg, i)
154
+ if v = bound_variable_arg(arg, nil)
155
+ obj = org.postgresql.util.PGobject.new
156
+ obj.setType("unknown")
157
+ obj.setValue(v)
158
+ cps.setObject(i, obj)
159
+ else
160
+ super
161
+ end
162
+ end
163
+
141
164
  # Use setNull for nil arguments as the default behavior of setString
142
165
  # with nil doesn't appear to work correctly on PostgreSQL.
143
166
  def set_ps_arg_nil(cps, i)
@@ -193,7 +216,7 @@ module Sequel
193
216
  def type_convertor(map, meta, type, i)
194
217
  case type
195
218
  when *PG_SPECIFIC_TYPES
196
- oid = meta.field(i).oid
219
+ oid = meta.getField(i).getOID
197
220
  if pr = db.oid_convertor_proc(oid)
198
221
  pr
199
222
  elsif type == ARRAY_TYPE
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/sqlanywhere'
2
4
  Sequel.require 'adapters/jdbc/transactions'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('org.sqlite.JDBC', :SQLite3)
2
4
  Sequel.require 'adapters/shared/sqlite'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel::JDBC.load_driver('com.microsoft.sqlserver.jdbc.SQLServerDriver')
2
4
  Sequel.require 'adapters/jdbc/mssql'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  module Sequel
2
4
  module JDBC
3
5
  module Transactions
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  module Sequel
2
4
  module Mock
3
5
  # Connection class for Sequel's mock adapter.
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  begin
2
4
  require "mysqlplus"
3
5
  rescue LoadError
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'mysql2'
2
4
  Sequel.require %w'shared/mysql_prepared_statements', 'adapters'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'odbc'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/db2'
2
4
 
3
5
  Sequel.synchronize do
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/mssql'
2
4
 
3
5
  module Sequel
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/progress'
2
4
 
3
5
  Sequel.synchronize do
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  require 'oci8'
2
4
  Sequel.require 'adapters/shared/oracle'
3
5
 
@@ -57,7 +59,7 @@ module Sequel
57
59
 
58
60
  def disconnect_connection(c)
59
61
  c.logoff
60
- rescue OCIInvalidHandle
62
+ rescue OCIException
61
63
  nil
62
64
  end
63
65
 
@@ -176,7 +178,7 @@ module Sequel
176
178
  args = cursor_bind_params(conn, cursor, opts[:arguments])
177
179
  log_sql = "EXECUTE #{name}"
178
180
  if ps.log_sql
179
- log_sql << " ("
181
+ log_sql += " ("
180
182
  log_sql << sql
181
183
  log_sql << ")"
182
184
  end
@@ -1,3 +1,5 @@
1
+ # frozen-string-literal: true
2
+
1
3
  Sequel.require 'adapters/shared/postgres'
2
4
 
3
5
  begin
@@ -375,7 +377,7 @@ module Sequel
375
377
  end
376
378
  nil
377
379
  else
378
- b = ''
380
+ b = String.new
379
381
  b << buf while buf = conn.get_copy_data
380
382
  b
381
383
  end
@@ -466,7 +468,7 @@ module Sequel
466
468
  begin
467
469
  channels = Array(channels)
468
470
  channels.each do |channel|
469
- sql = "LISTEN "
471
+ sql = "LISTEN ".dup
470
472
  dataset.send(:identifier_append, sql, channel)
471
473
  conn.execute(sql)
472
474
  end
@@ -589,7 +591,7 @@ module Sequel
589
591
 
590
592
  log_sql = "EXECUTE #{ps_name}"
591
593
  if ps.log_sql
592
- log_sql << " ("
594
+ log_sql += " ("
593
595
  log_sql << sql
594
596
  log_sql << ")"
595
597
  end