sequel 5.35.0 → 5.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +68 -0
- data/README.rdoc +2 -2
- data/doc/cheat_sheet.rdoc +5 -5
- data/doc/code_order.rdoc +0 -12
- data/doc/fork_safety.rdoc +84 -0
- data/doc/model_plugins.rdoc +1 -1
- data/doc/opening_databases.rdoc +5 -1
- data/doc/postgresql.rdoc +1 -1
- data/doc/querying.rdoc +3 -3
- data/doc/release_notes/5.36.0.txt +60 -0
- data/doc/release_notes/5.37.0.txt +30 -0
- data/doc/release_notes/5.38.0.txt +28 -0
- data/doc/release_notes/5.39.0.txt +19 -0
- data/doc/release_notes/5.40.0.txt +40 -0
- data/doc/transactions.rdoc +0 -8
- data/doc/validations.rdoc +1 -1
- data/lib/sequel/adapters/jdbc.rb +15 -3
- data/lib/sequel/adapters/jdbc/mysql.rb +4 -4
- data/lib/sequel/adapters/odbc.rb +4 -6
- data/lib/sequel/adapters/shared/mssql.rb +35 -5
- data/lib/sequel/adapters/shared/oracle.rb +13 -7
- data/lib/sequel/adapters/shared/postgres.rb +40 -2
- data/lib/sequel/adapters/shared/sqlite.rb +35 -1
- data/lib/sequel/adapters/utils/mysql_mysql2.rb +1 -0
- data/lib/sequel/core.rb +5 -6
- data/lib/sequel/database/connecting.rb +0 -1
- data/lib/sequel/database/misc.rb +14 -0
- data/lib/sequel/database/schema_generator.rb +6 -0
- data/lib/sequel/database/schema_methods.rb +16 -6
- data/lib/sequel/database/transactions.rb +2 -2
- data/lib/sequel/dataset/actions.rb +10 -6
- data/lib/sequel/dataset/features.rb +10 -0
- data/lib/sequel/dataset/prepared_statements.rb +2 -0
- data/lib/sequel/dataset/sql.rb +32 -10
- data/lib/sequel/extensions/blank.rb +6 -0
- data/lib/sequel/extensions/date_arithmetic.rb +6 -3
- data/lib/sequel/extensions/eval_inspect.rb +2 -0
- data/lib/sequel/extensions/inflector.rb +6 -0
- data/lib/sequel/extensions/migration.rb +10 -1
- data/lib/sequel/extensions/pg_array.rb +1 -0
- data/lib/sequel/extensions/pg_interval.rb +22 -6
- data/lib/sequel/extensions/pg_json_ops.rb +44 -2
- data/lib/sequel/extensions/pg_row.rb +1 -0
- data/lib/sequel/extensions/pg_row_ops.rb +24 -0
- data/lib/sequel/extensions/query.rb +3 -0
- data/lib/sequel/extensions/schema_dumper.rb +3 -3
- data/lib/sequel/model.rb +1 -1
- data/lib/sequel/model/associations.rb +1 -0
- data/lib/sequel/model/base.rb +23 -4
- data/lib/sequel/model/plugins.rb +6 -0
- data/lib/sequel/plugins/association_proxies.rb +3 -0
- data/lib/sequel/plugins/class_table_inheritance.rb +0 -5
- data/lib/sequel/plugins/composition.rb +5 -1
- data/lib/sequel/plugins/constraint_validations.rb +2 -1
- data/lib/sequel/plugins/dataset_associations.rb +4 -1
- data/lib/sequel/plugins/dirty.rb +44 -0
- data/lib/sequel/plugins/nested_attributes.rb +3 -1
- data/lib/sequel/plugins/pg_array_associations.rb +4 -0
- data/lib/sequel/plugins/pg_auto_constraint_validations.rb +2 -0
- data/lib/sequel/plugins/single_table_inheritance.rb +7 -0
- data/lib/sequel/plugins/tree.rb +9 -4
- data/lib/sequel/timezones.rb +8 -3
- data/lib/sequel/version.rb +1 -1
- metadata +33 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3391bf9fe9e592892ad8ba6b39f7016fe94524908243e7c85fdf5b1cbf9a62a
|
4
|
+
data.tar.gz: 3b3c946fefa8c16b8f657c191debf49f8db84cb9cadb5a91ecdb01739c2ec1e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/README.rdoc
CHANGED
@@ -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
|
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
|
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
|
|
data/doc/cheat_sheet.rdoc
CHANGED
@@ -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)}
|
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))
|
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}
|
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)}
|
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)
|
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
|
|
data/doc/code_order.rdoc
CHANGED
@@ -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
|
data/doc/model_plugins.rdoc
CHANGED
@@ -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
|
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
|
data/doc/opening_databases.rdoc
CHANGED
@@ -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
|
|
data/doc/postgresql.rdoc
CHANGED
@@ -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
|
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)
|
data/doc/querying.rdoc
CHANGED
@@ -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
|
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,
|
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!
|