sequel 5.35.0 → 5.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +68 -0
  3. data/README.rdoc +2 -2
  4. data/doc/cheat_sheet.rdoc +5 -5
  5. data/doc/code_order.rdoc +0 -12
  6. data/doc/fork_safety.rdoc +84 -0
  7. data/doc/model_plugins.rdoc +1 -1
  8. data/doc/opening_databases.rdoc +5 -1
  9. data/doc/postgresql.rdoc +1 -1
  10. data/doc/querying.rdoc +3 -3
  11. data/doc/release_notes/5.36.0.txt +60 -0
  12. data/doc/release_notes/5.37.0.txt +30 -0
  13. data/doc/release_notes/5.38.0.txt +28 -0
  14. data/doc/release_notes/5.39.0.txt +19 -0
  15. data/doc/release_notes/5.40.0.txt +40 -0
  16. data/doc/transactions.rdoc +0 -8
  17. data/doc/validations.rdoc +1 -1
  18. data/lib/sequel/adapters/jdbc.rb +15 -3
  19. data/lib/sequel/adapters/jdbc/mysql.rb +4 -4
  20. data/lib/sequel/adapters/odbc.rb +4 -6
  21. data/lib/sequel/adapters/shared/mssql.rb +35 -5
  22. data/lib/sequel/adapters/shared/oracle.rb +13 -7
  23. data/lib/sequel/adapters/shared/postgres.rb +40 -2
  24. data/lib/sequel/adapters/shared/sqlite.rb +35 -1
  25. data/lib/sequel/adapters/utils/mysql_mysql2.rb +1 -0
  26. data/lib/sequel/core.rb +5 -6
  27. data/lib/sequel/database/connecting.rb +0 -1
  28. data/lib/sequel/database/misc.rb +14 -0
  29. data/lib/sequel/database/schema_generator.rb +6 -0
  30. data/lib/sequel/database/schema_methods.rb +16 -6
  31. data/lib/sequel/database/transactions.rb +2 -2
  32. data/lib/sequel/dataset/actions.rb +10 -6
  33. data/lib/sequel/dataset/features.rb +10 -0
  34. data/lib/sequel/dataset/prepared_statements.rb +2 -0
  35. data/lib/sequel/dataset/sql.rb +32 -10
  36. data/lib/sequel/extensions/blank.rb +6 -0
  37. data/lib/sequel/extensions/date_arithmetic.rb +6 -3
  38. data/lib/sequel/extensions/eval_inspect.rb +2 -0
  39. data/lib/sequel/extensions/inflector.rb +6 -0
  40. data/lib/sequel/extensions/migration.rb +10 -1
  41. data/lib/sequel/extensions/pg_array.rb +1 -0
  42. data/lib/sequel/extensions/pg_interval.rb +22 -6
  43. data/lib/sequel/extensions/pg_json_ops.rb +44 -2
  44. data/lib/sequel/extensions/pg_row.rb +1 -0
  45. data/lib/sequel/extensions/pg_row_ops.rb +24 -0
  46. data/lib/sequel/extensions/query.rb +3 -0
  47. data/lib/sequel/extensions/schema_dumper.rb +3 -3
  48. data/lib/sequel/model.rb +1 -1
  49. data/lib/sequel/model/associations.rb +1 -0
  50. data/lib/sequel/model/base.rb +23 -4
  51. data/lib/sequel/model/plugins.rb +6 -0
  52. data/lib/sequel/plugins/association_proxies.rb +3 -0
  53. data/lib/sequel/plugins/class_table_inheritance.rb +0 -5
  54. data/lib/sequel/plugins/composition.rb +5 -1
  55. data/lib/sequel/plugins/constraint_validations.rb +2 -1
  56. data/lib/sequel/plugins/dataset_associations.rb +4 -1
  57. data/lib/sequel/plugins/dirty.rb +44 -0
  58. data/lib/sequel/plugins/nested_attributes.rb +3 -1
  59. data/lib/sequel/plugins/pg_array_associations.rb +4 -0
  60. data/lib/sequel/plugins/pg_auto_constraint_validations.rb +2 -0
  61. data/lib/sequel/plugins/single_table_inheritance.rb +7 -0
  62. data/lib/sequel/plugins/tree.rb +9 -4
  63. data/lib/sequel/timezones.rb +8 -3
  64. data/lib/sequel/version.rb +1 -1
  65. metadata +33 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ac0d24707f9029714f4e5258c484148d7dc10a733c0c33865d252141cd4cc2e
4
- data.tar.gz: cdabb1bb51fdfe7b7a22df0a6a9102dd15366bbdd98100907b2e3d74db4e5878
3
+ metadata.gz: b3391bf9fe9e592892ad8ba6b39f7016fe94524908243e7c85fdf5b1cbf9a62a
4
+ data.tar.gz: 3b3c946fefa8c16b8f657c191debf49f8db84cb9cadb5a91ecdb01739c2ec1e9
5
5
  SHA512:
6
- metadata.gz: d87a7d026c51d8897c964cca01ad30384b853bdbbda42811ee7245ef669ac23c1093e572a0e414db5daeb84b8f417e63c14c3ac13aa0b12ac9eb8f801ea6e6c2
7
- data.tar.gz: 3e788cabe74d01035b930ca699b5ebc763a6a34410c1b8a3a5075d5a276c5155355d9476303b6b606d1b0a74d6a535ca4fdca696cdc0b83e32658be45c8f946e
6
+ metadata.gz: 1e7812b8851cdcc9e374bcd8439cc4e3dbbedfd550c72b54aa9d6aa16e3bad1e5f59eed824bdef026d784b67450d2f861be8776ddb762be58406cca75f7a0ea9
7
+ data.tar.gz: a60bcc72355a1916a0639c5a99ec806f157d60b515112ec24c1757f9a43efc587593a0b11a1e5312d3f40431b313f8f6fc241eee7e7a37c5362565db7c4c8d3c
data/CHANGELOG CHANGED
@@ -1,3 +1,71 @@
1
+ === 5.40.0 (2021-01-01)
2
+
3
+ * Support UPDATE FROM syntax in SQLite 3.33.0+ (jeremyevans)
4
+
5
+ * Have pg_interval extension work with ActiveSupport 6.1 (jeremyevans)
6
+
7
+ * Have date_arithmetic extension work with ActiveSupport 6.1 (jeremyevans)
8
+
9
+ * Avoid method redefinition warnings in verbose warning mode (jeremyevans)
10
+
11
+ === 5.39.0 (2020-12-01)
12
+
13
+ * Support :clustered option for primary key and unique constraints on Microsoft SQL Server (jeremyevans)
14
+
15
+ * Do not modify the size of binary columns when using set_column_allow_null on Microsoft SQL Server (jeremyevans) (#1736)
16
+
17
+ * Add a fork safety guide with more detail on how to use Sequel with libraries that fork (janko) (#1733)
18
+
19
+ * Make the roots_dataset method in the tree plugin work with queries using joins (jeremyevans) (#1731)
20
+
21
+ * Make Database#tables return partitioned tables on PostgreSQL 10+ (epoberezhny) (#1729, #1730)
22
+
23
+ === 5.38.0 (2020-11-01)
24
+
25
+ * Do not add new Database instances to Sequel::DATABASES if the test connection fails (jeremyevans) (#1727)
26
+
27
+ * Support the newer com.mysql.cj.jdbc.Driver in the jdbc/mysql adapter (jeremyevans)
28
+
29
+ * Do not swallow disconnect errors in Database#create_or_replace_view or Database#create_table* on Oracle (jeremyevans)
30
+
31
+ * Only rescue non-disconnect Sequel::DatabaseErrors in Postgres::Database#server_version (jeremyevans) (#1724)
32
+
33
+ * Make the single_table_inheritance and prepared_statements plugins work if loaded into the same class (jeremyevans) (#1721)
34
+
35
+ === 5.37.0 (2020-10-01)
36
+
37
+ * Recognize more unsigned decimal/float types in the schema dumper (akimd, jeremyevans) (#1720)
38
+
39
+ * Add Postgres::PGRow::{Array,Hash}Row#op to the pg_row_ops extension if the pg_row extension is loaded (jeremyevans)
40
+
41
+ * Add Model#column_previously_was and #column_previously_changed? to the dirty plugin (jeremyevans)
42
+
43
+ * Raise Migrator::Error if attempting to migrate down to a version where there are necessary migration files missing (jeremyevans) (#1716)
44
+
45
+ === 5.36.0 (2020-09-01)
46
+
47
+ * Handle passing keyword arguments through class methods defined via Plugins.def_dataset_method on Ruby 2.7+ (jeremyevans)
48
+
49
+ * Handle passing keyword arguments through when loading plugins on Ruby 2.7+ (jeremyevans)
50
+
51
+ * Handle passing keyword arguments through migrations when defining custom Database methods that accept keywords on Ruby 2.7+ (jeremyevans)
52
+
53
+ * Handle passing keyword arguments through Dataset#query when using the query extension on Ruby 2.7+ (jeremyevans)
54
+
55
+ * Handle passing keyword arguments through the association proxy when using the association_proxies plugin on Ruby 2.7+ (jeremyevans)
56
+
57
+ * Handle passing keyword arguments through the class method to a method defined in dataset_module on Ruby 2.7+ (adam12) (#1713)
58
+
59
+ * Stream result sets in the odbc adapter for better performance and lower memory usage (sparrovv) (#1711)
60
+
61
+ * Add Postgres::JSONBOp#set_lax and #path_*_tz methods to the pg_json_ops extension for new jsonb functions added in PostgreSQL 13 (jeremyevans)
62
+
63
+ * Add Dataset#with_ties on PostgreSQL 13+ and Microsoft SQL Server to include rows with same order as final row (jeremyevans)
64
+
65
+ * Add a :current_schema option to Database#view_exists? (only defined on Oracle) to look in the current schema instead of non-system schemas (jeremyevans) (#1710)
66
+
67
+ * Recognize another disconnect error in the mysql and mysql2 adapters (jeremyevans) (#1706)
68
+
1
69
  === 5.35.0 (2020-08-01)
2
70
 
3
71
  * Recognize another disconnect error in the oracle adapter (sterlzbd) (#1705)
@@ -172,7 +172,7 @@ Datasets are the primary way records are retrieved and manipulated. They are ge
172
172
  posts = DB.from(:posts)
173
173
  posts = DB[:posts] # same
174
174
 
175
- Datasets will only fetch records when you tell them to. They can be manipulated to filter records, change ordering, join tables, etc.. Datasets are always frozen, and they safe to use by multiple threads concurrently.
175
+ Datasets will only fetch records when you tell them to. They can be manipulated to filter records, change ordering, join tables, etc. Datasets are always frozen, and they are safe to use by multiple threads concurrently.
176
176
 
177
177
  === Retrieving Records
178
178
 
@@ -883,7 +883,7 @@ raise an error by default:
883
883
  == Sequel Release Policy
884
884
 
885
885
  New major versions of Sequel do not have a defined release policy, but historically have
886
- occurred once ever few years.
886
+ occurred once every few years.
887
887
 
888
888
  New minor versions of Sequel are released around once a month near the start of the month.
889
889
 
@@ -95,18 +95,18 @@ Without a filename argument, the sqlite adapter will setup a new sqlite database
95
95
 
96
96
  === AND/OR/NOT
97
97
 
98
- DB[:items].where{(x > 5) & (y > 10)}.sql
98
+ DB[:items].where{(x > 5) & (y > 10)}
99
99
  # SELECT * FROM items WHERE ((x > 5) AND (y > 10))
100
100
 
101
- DB[:items].where(Sequel.or(x: 1, y: 2) & Sequel.~(z: 3)).sql
101
+ DB[:items].where(Sequel.or(x: 1, y: 2) & Sequel.~(z: 3))
102
102
  # SELECT * FROM items WHERE (((x = 1) OR (y = 2)) AND (z != 3))
103
103
 
104
104
  === Mathematical operators
105
105
 
106
- DB[:items].where{x + y > z}.sql
106
+ DB[:items].where{x + y > z}
107
107
  # SELECT * FROM items WHERE ((x + y) > z)
108
108
 
109
- DB[:items].where{price - 100 < avg(price)}.sql
109
+ DB[:items].where{price - 100 < avg(price)}
110
110
  # SELECT * FROM items WHERE ((price - 100) < avg(price))
111
111
 
112
112
  === Raw SQL Fragments
@@ -130,7 +130,7 @@ Without a filename argument, the sqlite adapter will setup a new sqlite database
130
130
 
131
131
  == Joins
132
132
 
133
- DB[:items].left_outer_join(:categories, id: :category_id).sql
133
+ DB[:items].left_outer_join(:categories, id: :category_id)
134
134
  # SELECT * FROM items
135
135
  # LEFT OUTER JOIN categories ON categories.id = items.category_id
136
136
 
@@ -100,15 +100,3 @@ and freezing them can easily be achieved through the plugin:
100
100
  # ... setup models
101
101
  # Now finalize associations & freeze models by calling the plugin:
102
102
  Sequel::Model.freeze_descendents
103
-
104
- == Disconnect If Using Forking Webserver with Code Preloading
105
-
106
- If you are using a forking webserver such as unicorn or passenger, with
107
- a feature that loads your Sequel code before forking connections (code
108
- preloading), then you must disconnect your database connections before
109
- forking. If you don't do this, you can end up with child processes
110
- sharing database connections and all sorts of weird behavior. Sequel
111
- will automatically reconnect on an as needed basis in the child
112
- processes, so you only need to do the following in the parent process:
113
-
114
- DB.disconnect
@@ -0,0 +1,84 @@
1
+ = Fork Safety
2
+
3
+ If you are forking or using a library that forks after you have created a
4
+ Sequel::Database instance, then you must disconnect database connections before forking. If you
5
+ don't do this, you can end up with child processes sharing database connections
6
+ and all sorts of weird behavior, including crashes. Sequel will automatically create new
7
+ connections on an as needed basis in the child processes, so you only need to do the following in
8
+ the parent process:
9
+
10
+ DB.disconnect
11
+
12
+ Or if you have connections to multiple databases:
13
+
14
+ Sequel::DATABASES.each(&:disconnect)
15
+
16
+ == Puma
17
+
18
+ When using the Puma web server in clustered mode (which is the default behavior in Puma 5+ when
19
+ using multiple processes), you should disconnect inside the +before_fork+ hook in your
20
+ Puma config:
21
+
22
+ before_fork do
23
+ Sequel::DATABASES.each(&:disconnect)
24
+ end
25
+
26
+ == Unicorn
27
+
28
+ When using the Unicorn web server and preloading the application (+preload_app true+ in the Unicorn
29
+ config), you should disconnect inside the +before_fork+ hook in the Unicorn config:
30
+
31
+ before_fork do
32
+ Sequel::DATABASES.each(&:disconnect)
33
+ end
34
+
35
+ == Passenger
36
+
37
+ In Passenger web server, you should disconnect inside the
38
+ +starting_worker_process+ event hook:
39
+
40
+ if defined?(PhusionPassenger)
41
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
42
+ Sequel::DATABASES.each(&:disconnect) if forked
43
+ end
44
+ end
45
+
46
+ Note that this disconnects after forking instead of before forking. Passenger does not
47
+ offer a before fork hook.
48
+
49
+ == Spring
50
+
51
+ In Spring application preloader, you should disconnect inside the +after_fork+ hook:
52
+
53
+ if defined?(Spring)
54
+ Spring.after_fork do
55
+ Sequel::DATABASES.each(&:disconnect)
56
+ end
57
+ end
58
+
59
+ As the method indicates, this disconnects after forking instead of before forking.
60
+ Spring does not offer a before fork hook.
61
+
62
+ == Resque
63
+
64
+ In Resque, you should disconnect inside the +before_fork+ hook:
65
+
66
+ Resque.before_fork do |job|
67
+ Sequel::DATABASES.each(&:disconnect)
68
+ end
69
+
70
+ == Parallel
71
+
72
+ If you're using the Parallel gem with processes, you should disconnect before
73
+ calling it:
74
+
75
+ Sequel::DATABASES.each(&:disconnect)
76
+ Parallel.map(['a','b','c'], in_processes: 3) { |one_letter| }
77
+
78
+ == Other Libraries Calling fork
79
+
80
+ For any other library that calls fork, you should disconnect before calling
81
+ a method that forks:
82
+
83
+ Sequel::DATABASES.each(&:disconnect)
84
+ SomeLibrary.method_that_forks
@@ -212,7 +212,7 @@ In general you should only require plugin arguments if you absolutely must have
212
212
 
213
213
  == Handling Subclasses
214
214
 
215
- Sequel::Model uses a copy-on-subclassing approach to model state. So instead of model subclasses asking their parent class for a value if they don't have it defined, the value is automatically copied from the parent class to the subclass when the subclass is created. While you can do this by overriding the inherited class method, there is a available shortcut that handles most cases:
215
+ Sequel::Model uses a copy-on-subclassing approach to model state. So instead of having a model subclass ask its superclass for a value if the subclass don't have the value defined, the value should be copied from the parent class to the subclass when the subclass is created. While this can be implemented by overriding the +inherited+ class method, there is an available shortcut that handles most cases:
216
216
 
217
217
  module Sequel::Plugins::Foo
218
218
  module ClassMethods
@@ -208,7 +208,7 @@ Example connection strings:
208
208
 
209
209
  jdbc:sqlite::memory:
210
210
  jdbc:postgresql://localhost/database?user=username
211
- jdbc:mysql://localhost/test?user=root&password=root
211
+ jdbc:mysql://localhost/test?user=root&password=root&serverTimezone=UTC
212
212
  jdbc:h2:mem:
213
213
  jdbc:hsqldb:mem:mymemdb
214
214
  jdbc:derby:memory:myDb;create=true
@@ -240,6 +240,10 @@ The following additional options are supported:
240
240
  There are a few issues with specific jdbc driver gems:
241
241
 
242
242
  jdbc-h2 :: jdbc-h2 versions greater than 1.3.175 have issues with ORDER BY not working correctly in some cases.
243
+ jdbc-mysql :: Depending on the configuration of the MySQL server, jdbc-mysql versions greater 8 may complain
244
+ about the server time zone being unrecognized. You can either use an older jdbc-mysql version,
245
+ or you can specify the +serverTimezone+ option in the connection string, as shown in the example
246
+ jdbc:mysql connection string above.
243
247
 
244
248
  === mysql
245
249
 
@@ -213,7 +213,7 @@ other tables. Support may be added in the future.
213
213
  === Creating Unlogged Tables
214
214
 
215
215
  PostgreSQL allows users to create unlogged tables, which are faster but not crash safe. Sequel
216
- allows you do create an unlogged table by specifying the <tt>unlogged: true</tt> option to +create_table+:
216
+ allows you to create an unlogged table by specifying the <tt>unlogged: true</tt> option to +create_table+:
217
217
 
218
218
  DB.create_table(:table, unlogged: true){Integer :i}
219
219
  # CREATE UNLOGGED TABLE "table" ("i" integer)
@@ -746,7 +746,7 @@ shortcuts for all common (and most uncommon) join types. For example
746
746
 
747
747
  Album.join(:artists, id: :artist_id)
748
748
  # SELECT * FROM albums
749
- # INNER JOIN artists ON (artists.id = albums.artist_id))))
749
+ # INNER JOIN artists ON (artists.id = albums.artist_id)
750
750
 
751
751
  And +left_join+ does a LEFT JOIN:
752
752
 
@@ -870,14 +870,14 @@ In this case, you don't even need to specify any conditions.
870
870
  ==== Join Blocks
871
871
 
872
872
  You can provide a block to any of the join methods that accept
873
- conditions. This block should accept 3 arguments, the table alias
873
+ conditions. This block should accept 3 arguments: the table alias
874
874
  for the table currently being joined, the table alias for the last
875
875
  table joined (or first table), and an array of previous
876
876
  <tt>Sequel::SQL::JoinClause</tt>s.
877
877
 
878
878
  This allows you to qualify columns similar to how the implicit
879
879
  qualification works, without worrying about the specific aliases
880
- being used. For example, lets say you wanted to join the albums
880
+ being used. For example, let's say you wanted to join the albums
881
881
  and artists tables, but only want albums where the artist's name
882
882
  comes before the album's name.
883
883
 
@@ -0,0 +1,60 @@
1
+ = New Features
2
+
3
+ * Dataset#with_ties has been added on PostgreSQL 13+ and Microsoft
4
+ SQL Server, which will have a limited dataset also return all
5
+ rows with the same order as the final row.
6
+
7
+ * In the pg_json_ops extension, the following methods have been
8
+ added to Postgres::JSONBOp, all of which require PostgreSQL 13+:
9
+
10
+ * #set_lax
11
+ * #path_exists_tz!
12
+ * #path_match_tz!
13
+ * #path_query_tz
14
+ * #path_query_array_tz
15
+ * #path_query_first_tz
16
+
17
+ * On Oracle, the Database#view_exists? method now accepts a
18
+ :current_schema option to limit the views returned to the
19
+ current schema, instead of all non-system schemas.
20
+
21
+ = Other Improvements
22
+
23
+ * Sequel will now pass keyword arguments through in the following
24
+ cases:
25
+
26
+ * When loading plugins (Model.plugin)
27
+
28
+ * Class methods automically defined for methods defined in a
29
+ Model.dataset_module block
30
+
31
+ * Methods defined by Plugins.def_dataset_method
32
+
33
+ * Database methods called inside migrations
34
+
35
+ * Methods called via an association proxy when using the
36
+ association_proxies plugin.
37
+
38
+ * Dataset methods called inside a Dataset#query block when using
39
+ the query extension.
40
+
41
+ Previously, keywords were not handled in these cases, which would
42
+ cause deprecation warnings in Ruby 2.7 and ArgumentErrors in Ruby
43
+ 3.0. Note that Sequel itself does not use keyword arguments at
44
+ all, so all of these changes only affect cases where external
45
+ methods are defined that accept keywords, and Sequel methods are
46
+ called with keywords that end up being delegated to the external
47
+ methods.
48
+
49
+ * The odbc adapter will now stream result sets instead of loading
50
+ the entire result set in memory and then iterating over it.
51
+
52
+ * Sequel now recognizes another disconnect error in the mysql and
53
+ mysql2 adapters.
54
+
55
+ = Backwards Compatibility
56
+
57
+ * Due to the odbc adapter change to use streaming, issuing queries
58
+ inside a Dataset#each block will no longer work unless a different
59
+ shard or thread is used. The behavior of such code is considered
60
+ undefined on all Sequel adapters.
@@ -0,0 +1,30 @@
1
+ = New Features
2
+
3
+ * Model#column_previously_was and #column_previously_changed? have
4
+ been added to the dirty plugin, for getting the previous values
5
+ of the column before saving and for whether there were changes
6
+ before saving.
7
+
8
+ Model#column_previously_changed? accepts :from and :to options
9
+ to allow you to more easily determine if the value changed from
10
+ and/or to specific values.
11
+
12
+ This information was previously obtainable via
13
+ Model#previous_changes, but these new methods offer a friendlier
14
+ interface.
15
+
16
+ * Postgres::PGRow::{Array,Hash}Row#op has been added to the
17
+ pg_row_ops extension if the pg_row extension is loaded. This
18
+ is similar to how the pg_array_ops, pg_hstore_ops, and
19
+ pg_json_ops and #op method to their objects. This makes it
20
+ easier to perform row operations on literal rows.
21
+
22
+ = Other Improvements
23
+
24
+ * The schema_dumper extension now supports more unsigned numeric
25
+ types, such as "decimal(7,2) unsigned" and "real unsigned".
26
+
27
+ * IntegerMigrator now raises an Migrator::Error if attempting to
28
+ migrate down when there are migration files missing and needed for
29
+ the down migration. Previously, IntegerMigrator would not raise an
30
+ exception and would make no database changes in this case.
@@ -0,0 +1,28 @@
1
+ = New Features
2
+
3
+ * The jdbc/mysql adapter now supports the newer
4
+ com.mysql.cj.jdbc.Driver driver. The adapter will still attempt to
5
+ load the older com.mysql.jdbc.Driver if the com.mysql.cj.jdbc.Driver
6
+ is not found.
7
+
8
+ = Other Improvements
9
+
10
+ * When testing a connection after creating a new Database instance
11
+ raises an exception, the Database instance is removed from
12
+ Sequel::DATABASES.
13
+
14
+ * The single_table_inheritance and prepared_statements plugins now
15
+ work correctly if loaded into the same class.
16
+
17
+ * Database connect and disconnect errors are no longer swallowed when
18
+ calling Database#create_or_replace_view, Database#server_version
19
+ on PostgreSQL, or Database#create_table* on Oracle.
20
+
21
+ = Backwards Compatibility
22
+
23
+ * Previously, instantiating a new Database instance directly using
24
+ Sequel::Database.new did not test the connection by default. That
25
+ was instead handled by Sequel::Database.connect. The test
26
+ connection now happens inside Database#initialize. This should only
27
+ affect backwards compatibility for code that is calling
28
+ Sequel::Database.new directly.
@@ -0,0 +1,19 @@
1
+ = New Features
2
+
3
+ * On Microsoft SQL Server, the :clustered option is now supported
4
+ for primary key and unique constraints. You can use a true value
5
+ for CLUSTERED and a false value for NONCLUSTERED.
6
+
7
+ = Other Improvements
8
+
9
+ * Partitioned tables are now included in the result of
10
+ Database#tables on PostgreSQL.
11
+
12
+ * alter_table set_column_allow_null no longer drops the size of
13
+ binary columns on Microsoft SQL Server.
14
+
15
+ * In the tree plugin, the roots_dataset method now works correctly
16
+ with queries using joins by qualifying the parent column.
17
+
18
+ * A fork safety guide has been added, discussing fork safety issues
19
+ when using Sequel.
@@ -0,0 +1,40 @@
1
+ = New Features
2
+
3
+ * On SQLite 3.33.0+, the UPDATE FROM syntax is now supported. This
4
+ allows you to update one table based on a join to another table.
5
+ The SQLite syntax is based on the PostgreSQL syntax, and the
6
+ Sequel API is the same for both. You need to pass multiple tables
7
+ to Dataset#from. The first table is the table to update, and the
8
+ remaining tables are used to construct the UPDATE FROM clause:
9
+
10
+ DB[:a, :b].where{{a[:c]=>b[:d]}}.update(:e=>'f')
11
+ # UPDATE a SET e = 'f' FROM b WHERE (a.c = b.d)
12
+
13
+ Unlike PostgreSQL, SQLite does not support the deletion of joined
14
+ datasets. Related to this, the following methods for testing
15
+ database support for modifying joined datasets have been added:
16
+
17
+ * supports_updating_joins?
18
+ * supports_deleting_joins?
19
+
20
+ = Other Improvements
21
+
22
+ * The pg_interval and date_arithmetic extensions now support
23
+ ActiveSupport 6.1.
24
+
25
+ * Sequel no longer issues method redefinition warnings in verbose
26
+ mode. As Ruby 3 has dropped uninitialized instance variable
27
+ warnings, Sequel is now verbose warning free on Ruby 3.
28
+
29
+ = Backwards Compatibility
30
+
31
+ * Trying to truncate or insert into a joined dataset now correctly
32
+ raises an exception even if the joined dataset supports updates.
33
+
34
+ * The private Dataset#check_modification_allowed! method is now
35
+ deprecated, and users (custom adapters) should now switch to one
36
+ of the more specific methods introduced in this version:
37
+
38
+ * check_insert_allowed!
39
+ * check_update_allowed!
40
+ * check_delete_allowed!