3
* Dataset#paged_each has been added, for processing entire datasets
4
without keeping all rows in memory, even if the underlying driver
5
keeps all query results in memory. This is implemented using
6
limits and offsets, and requires an order (model datasets use a
7
default order by primary key). It defaults to fetching 1000
8
rows at a time, but that can be changed via the :rows_per_fetch
11
This method is drop-in compatible for each. Previously, the
12
pagination extension's each_page method could be used for a
13
similar purpose, but users of each_page are now encouraged to
16
* Sequel now recognizes constraint violation exceptions on most
17
databases, and will raise specific exceptions for different
18
types of constraint violations, instead of the generic
19
Sequel::DatabaseError:
21
* Sequel::ConstraintViolation (generic superclass)
22
* Sequel::CheckConstraintViolation
23
* Sequel::NotNullConstraintViolation
24
* Sequel::ForeignKeyConstraintViolation
25
* Sequel::UniqueConstraintViolation
26
* Sequel::Postgres::ExclusionConstraintViolation
28
* The :dataset association option can now take accept an optional
29
association reflection option. Instead of doing:
31
Album.one_to_many :artists,
36
Album.one_to_many :artists,
37
:dataset=>{|r| r.associated_dataset...}
39
This second form will preform better.
41
* Temporary views are now supported on PostgreSQL and SQLite using
42
the :temp option to create_view.
46
* Row fetching speed in the tinytds adapter has been increased by
49
* Row fetching speed in the mysql2 adapter when using an identifier
50
output method has been increased by up to 50%.
52
* On databases where offsets are emulated via the ROW_NUMBER window
53
function (Oracle, DB2, Microsoft SQL Server), using an offset in
54
a subselect is now supported. For example, the following code
55
previously didn't work correctly with emulated offsets:
57
# Second 5 rows ordered by column2 of the second 10 rows ordered
59
DB[:table].order(:column1).limit(10, 10).
60
from_self.order(:column2).limit(5, 5)
62
Row processing speed has been increased slightly for all adapters
63
that supported databases where offsets are emulated.
65
* Association method performance has improved by caching an
66
intermediate dataset. This can close to triple the performance
67
of the association_dataset method, and increase the performance
68
of the association method by close to 30%.
70
* Virtual Row performance has increased about 30% in the typical
71
case by using a shared VirtualRow instance.
73
* Database#create_or_replace_view is now emulated on databases that
74
don't support it directly by dropping the view before attempting
77
* The columns_introspection extension can now introspect for simple
78
select * queries from subselects, and it can now use the cached
79
schema information in the database for simple select * queries
82
* The identity_map plugin now works correctly with many-to-many
83
right-side composite keys.
85
* Dataset#last for Model datasets now works even if you don't specify
86
an order explicitly, giving the last entry by primary key. Note
87
that Dataset#first for model datasets still does not order by
90
* The eager_each plugin no longer uses Object#extend at runtime.
92
* Database#remove_cached_schema is now thread-safe on non-GVL ruby
95
* Connection errors in the jdbc adapter now provide slightly more
98
* Sequel now uses the standard offset emulation code in the
99
jdbc/as400 adapter, instead of custom offset emulation code
100
specific to that adapter.
102
* Database#create_view with a dataset now works correctly when using
103
the pg_auto_parameterize extension.
105
* Database#columns no longer calls the row_proc.
107
* Dataset#schema_and_table no longer turns a literal string into a
110
* The oracle adapter now works with a :prefetch_rows=>nil option,
111
which explicitly disables prefetching.
113
* The mock mssql adapter now sets a server_version so that more
116
= Backwards Compatibility
118
* Offset emulation via ROW_NUMBER works by moving the query to a
119
subselect that also selects from the ROW_NUMBER window function,
120
and filtering on the ROW_NUMBER in the main query. Previously, the
121
ROW_NUMBER was also present in the output columns, and some
122
adapter code was needed to hide that fact. Now, the outer select
123
selects all of the inner columns in the subselect except for the
124
ROW_NUMBER, reducing the adapter code needed. This has the side
125
effect of potentially requiring a query (or multiple queries for
126
multiple subselects) to determine the columns to use. The
127
columns_introspection extension may reduce the number of queries
130
* The correlated_subquery eager limit strategy is no longer supported
131
on Microsoft SQL Server for many_*_many associations. As the
132
window_function eager limit strategy is supported there, there is
133
no reason to use the correlated_subquery strategy.
135
* The public AssociationReflection#_dataset_method method has been
138
* The private _*_dataset methods for associations (e.g.
139
_albums_dataset) have been removed.
141
* The private Dataset#offset_returns_row_number_column? method has
144
* :conditions options for associations are now added to the
145
association dataset before the foreign key filters, instead of
146
after. This should have no effect unless you were introspecting
147
the dataset's opts or sql and acting on it.
149
* The added abilities in the columns_introspection plugin to use
150
cached schema for introspection can now cause it to return
151
incorrect results if the table's schema has changed since it was