File: 5.0.0.txt

package info (click to toggle)
ruby-sequel 5.63.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,408 kB
  • sloc: ruby: 113,747; makefile: 3
file content (159 lines) | stat: -rw-r--r-- 5,673 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
= Major Changes

* Datasets are now frozen by default.  Since Sequel's inception,
  datasets have used a method-chaining API that returned modified
  copies, but previously they still supported direct mutation.  Now,
  datasets are always frozen and cannot be mutated. This allows many
  additional default optimizations related to caching, and provides
  greater thread safety.

    ds = DB[:table]

    # Before
    ds.row_proc = lambda{|h| h}

    # Now
    ds = ds.with_row_proc(lambda{|h| h})

* Symbol splitting to create qualified and/or aliased identifiers is
  now disabled by default.  While symbol splitting allowed for shorter
  code, it was not obvious and caused significant issues when using
  column names with embedded double or triple underscores.  Sequel now
  offers many ways to create qualified and/or aliased identifiers.

    # Before
    :table__column          # "table"."column"

    # Now
    :table__column          # "table__column"
    Sequel[:table][:column] # "table"."column"

    # To get back historical behavior
    Sequel.split_symbols = true

* Sequel no longer allows the use of plain ruby strings as SQL code
  fragments in the dataset filtering methods, as that makes it
  easier to introduce SQL injection vulnerabilities.  You can use
  Sequel.lit to create literal strings (SQL code fragments), which
  makes it easier to do security auditing of applications using
  Sequel.

    # Before
    DB[:table].where("column = 1").all

    # Now 
    DB[:table].where(Sequel.lit("column = 1")).all
    # or better
    DB[:table].where(column: 1).all

    # To get back historical behavior
    DB.extension :auto_literal_strings

= Backwards Compatibility

* All adapters, extensions, plugins, features, and constants
  deprecated in 4.49.0 have been removed.  Before upgrading to Sequel
  5.0.0, upgrade to 4.49.0 and fix all deprecation warnings.

* Support for ruby 1.8.7 has been dropped, the minimum ruby version is
  now 1.9.2.

* The {before,after,around}_validation hooks are now always called
  when saving, even if the validate: false option is used.  This
  allows you to use the before_validation hook to make changes
  to the model instance that are required before validation and
  before saving even if not validating.

* Getting column values for newly created model instances after
  insertion now happens before after_create is called, instead of
  after.

* Sequel now immediately attempts to the connect to the database
  when a Database instance is created, in order to fail fast if the
  connection parameters are invalid.

* The validates_unique method in the validation_helpers plugin
  now only checks for uniqueness by default if the record is new or
  one of the related columns has been modified by default.

* Database schema modification methods and schema generator methods
  now return nil instead of some internal value.

* Many cases where Sequel used Kernel#send internally have been
  switched to Kernel#public_send so they only call public methods.

* Model association hooks are now nil instead of empty arrays by
  default.

* Internal uses of instance_eval with a block have been changed to
  instance_exec.  This allows them to be used with lambdas that
  take no arguments.

* Most internal constants are now frozen, unless there is a
  requirement that they be modified at runtime.
  
* The Model @was_new instance variable is now no longer set when
  saving new model instances.

* The private Sequel::Postgres::PGArray::Parser#new_entry_buffer
  method in the pg_array extension has been removed.

* Modifying Model.input_transformer_order in the input_transformer
  plugin no longer has an effect.

= New Features

* Database#add_index :if_not_exists option is now supported on
  PostgreSQL 9.5+.

* SQL::Subscript#expression has been added to retrieve the
  expression that is subscripted.

= Other Improvements

* Threaded connection pools no longer block while new connections
  are being made.  Previously, attempting to establish a new
  connection blocked all connection pool activity until the new
  connection was made.

* Many minor performance improvements have been made.

* The class_table_inheritance plugin now raises an error during
  Model#update if a query does not modify a single row, just as
  the default Model#update does.

* ConnectionPool#size is now thread-safe in both threaded
  connection pools. Internal callers that already have the
  connection pool mutex should switch to using #_size (a new
  private method).

* Registration of new serialization formats in the serialization
  plugin is now thread-safe.

* If transactional schema modifications are not supported, a
  savepoint will not automatically be created when adding
  indexes for new tables inside transactions.  This fixes issues
  when making schema changes inside transactions on MySQL.

* Attempting to create a prepared statement using a dataset that
  uses a delayed evaluation now raises an error, because the
  prepared statement would not respect the delayed evaluation.

* The bin/sequel -M option now uses base 10.  Previously, it
  used the Kernel#Integer default, which was base 8 if there was
  a preceding 0.

= Deprecated Features

These deprecated features will be removed in Sequel 5.1.0.

* Model.allowed_columns in the base plugin is now deprecated. Use
  the whitelist_security plugin if you want to call it.

* Model use_after_commit_rollback class and instance accessors are
  now deprecated.

* Defining the Model#_before_validation method is now deprecated.
  You can change to using before_validation.

* The private Model.plugin_module_defined? method is now deprecated.