sequel 5.6.0 → 5.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +30 -5099
- data/Rakefile +1 -1
- data/doc/opening_databases.rdoc +0 -2
- data/doc/postgresql.rdoc +31 -0
- data/doc/querying.rdoc +2 -2
- data/doc/release_notes/5.7.0.txt +108 -0
- data/doc/testing.rdoc +1 -0
- data/lib/sequel/adapters/jdbc/derby.rb +1 -1
- data/lib/sequel/adapters/jdbc/oracle.rb +11 -0
- data/lib/sequel/adapters/postgres.rb +1 -0
- data/lib/sequel/adapters/shared/postgres.rb +117 -13
- data/lib/sequel/connection_pool/sharded_threaded.rb +7 -6
- data/lib/sequel/connection_pool/threaded.rb +6 -6
- data/lib/sequel/core.rb +20 -0
- data/lib/sequel/database/logging.rb +3 -2
- data/lib/sequel/database/schema_generator.rb +1 -2
- data/lib/sequel/dataset/actions.rb +15 -5
- data/lib/sequel/extensions/connection_expiration.rb +3 -3
- data/lib/sequel/extensions/connection_validator.rb +3 -3
- data/lib/sequel/extensions/integer64.rb +30 -0
- data/lib/sequel/extensions/migration.rb +2 -3
- data/lib/sequel/plugins/pg_array_associations.rb +5 -3
- data/lib/sequel/plugins/validate_associated.rb +18 -0
- data/lib/sequel/version.rb +1 -1
- data/spec/adapters/mssql_spec.rb +6 -6
- data/spec/adapters/mysql_spec.rb +1 -1
- data/spec/adapters/oracle_spec.rb +15 -1
- data/spec/adapters/postgres_spec.rb +78 -1
- data/spec/adapters/spec_helper.rb +3 -1
- data/spec/bin_spec.rb +1 -0
- data/spec/core/dataset_spec.rb +10 -0
- data/spec/extensions/integer64_spec.rb +22 -0
- data/spec/extensions/pg_array_associations_spec.rb +14 -2
- data/spec/extensions/spec_helper.rb +1 -0
- data/spec/integration/associations_test.rb +4 -4
- data/spec/integration/dataset_test.rb +2 -0
- data/spec/integration/spec_helper.rb +5 -11
- data/spec/model/spec_helper.rb +1 -0
- metadata +35 -165
- data/doc/release_notes/1.0.txt +0 -38
- data/doc/release_notes/1.1.txt +0 -143
- data/doc/release_notes/1.3.txt +0 -101
- data/doc/release_notes/1.4.0.txt +0 -53
- data/doc/release_notes/1.5.0.txt +0 -155
- data/doc/release_notes/2.0.0.txt +0 -298
- data/doc/release_notes/2.1.0.txt +0 -271
- data/doc/release_notes/2.10.0.txt +0 -328
- data/doc/release_notes/2.11.0.txt +0 -215
- data/doc/release_notes/2.12.0.txt +0 -534
- data/doc/release_notes/2.2.0.txt +0 -253
- data/doc/release_notes/2.3.0.txt +0 -88
- data/doc/release_notes/2.4.0.txt +0 -106
- data/doc/release_notes/2.5.0.txt +0 -137
- data/doc/release_notes/2.6.0.txt +0 -157
- data/doc/release_notes/2.7.0.txt +0 -166
- data/doc/release_notes/2.8.0.txt +0 -171
- data/doc/release_notes/2.9.0.txt +0 -97
- data/doc/release_notes/3.0.0.txt +0 -221
- data/doc/release_notes/3.1.0.txt +0 -406
- data/doc/release_notes/3.10.0.txt +0 -286
- data/doc/release_notes/3.11.0.txt +0 -254
- data/doc/release_notes/3.12.0.txt +0 -304
- data/doc/release_notes/3.13.0.txt +0 -210
- data/doc/release_notes/3.14.0.txt +0 -118
- data/doc/release_notes/3.15.0.txt +0 -78
- data/doc/release_notes/3.16.0.txt +0 -45
- data/doc/release_notes/3.17.0.txt +0 -58
- data/doc/release_notes/3.18.0.txt +0 -120
- data/doc/release_notes/3.19.0.txt +0 -67
- data/doc/release_notes/3.2.0.txt +0 -268
- data/doc/release_notes/3.20.0.txt +0 -41
- data/doc/release_notes/3.21.0.txt +0 -87
- data/doc/release_notes/3.22.0.txt +0 -39
- data/doc/release_notes/3.23.0.txt +0 -172
- data/doc/release_notes/3.24.0.txt +0 -420
- data/doc/release_notes/3.25.0.txt +0 -88
- data/doc/release_notes/3.26.0.txt +0 -88
- data/doc/release_notes/3.27.0.txt +0 -82
- data/doc/release_notes/3.28.0.txt +0 -304
- data/doc/release_notes/3.29.0.txt +0 -459
- data/doc/release_notes/3.3.0.txt +0 -192
- data/doc/release_notes/3.30.0.txt +0 -135
- data/doc/release_notes/3.31.0.txt +0 -146
- data/doc/release_notes/3.32.0.txt +0 -202
- data/doc/release_notes/3.33.0.txt +0 -157
- data/doc/release_notes/3.34.0.txt +0 -671
- data/doc/release_notes/3.35.0.txt +0 -144
- data/doc/release_notes/3.36.0.txt +0 -245
- data/doc/release_notes/3.37.0.txt +0 -338
- data/doc/release_notes/3.38.0.txt +0 -234
- data/doc/release_notes/3.39.0.txt +0 -237
- data/doc/release_notes/3.4.0.txt +0 -325
- data/doc/release_notes/3.40.0.txt +0 -73
- data/doc/release_notes/3.41.0.txt +0 -155
- data/doc/release_notes/3.42.0.txt +0 -74
- data/doc/release_notes/3.43.0.txt +0 -105
- data/doc/release_notes/3.44.0.txt +0 -152
- data/doc/release_notes/3.45.0.txt +0 -179
- data/doc/release_notes/3.46.0.txt +0 -122
- data/doc/release_notes/3.47.0.txt +0 -270
- data/doc/release_notes/3.48.0.txt +0 -477
- data/doc/release_notes/3.5.0.txt +0 -510
- data/doc/release_notes/3.6.0.txt +0 -366
- data/doc/release_notes/3.7.0.txt +0 -179
- data/doc/release_notes/3.8.0.txt +0 -151
- data/doc/release_notes/3.9.0.txt +0 -233
@@ -1,118 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* Dataset#grep now accepts :all_patterns, :all_columns, and
|
4
|
-
:case_insensitive options. Previously, grep would use a case
|
5
|
-
sensitive search where it would match if any pattern matched any
|
6
|
-
column. These three options give you more control over how the
|
7
|
-
pattern matching will work:
|
8
|
-
|
9
|
-
dataset.grep([:a, :b], %w'%test% foo')
|
10
|
-
# WHERE ((a LIKE '%test%') OR (a LIKE 'foo')
|
11
|
-
# OR (b LIKE '%test%') OR (b LIKE 'foo'))
|
12
|
-
|
13
|
-
dataset.grep([:a, :b], %w'%foo% %bar%', :all_patterns=>true)
|
14
|
-
# WHERE (((a LIKE '%foo%') OR (b LIKE '%foo%'))
|
15
|
-
# AND ((a LIKE '%bar%') OR (b LIKE '%bar%')))
|
16
|
-
|
17
|
-
dataset.grep([:a, :b], %w'%foo% %bar%', :all_columns=>true)
|
18
|
-
# WHERE (((a LIKE '%foo%') OR (a LIKE '%bar%'))
|
19
|
-
# AND ((b LIKE '%foo%') OR (b LIKE '%bar%')))
|
20
|
-
|
21
|
-
dataset.grep([:a, :b], %w'%foo% %bar%',
|
22
|
-
:all_patterns=>true,:all_columns=>true)
|
23
|
-
# WHERE ((a LIKE '%foo%') AND (b LIKE '%foo%')
|
24
|
-
# AND (a LIKE '%bar%') AND (b LIKE '%bar%'))
|
25
|
-
|
26
|
-
dataset.grep([:a, :b], %w'%test% foo', :case_insensitive=>true)
|
27
|
-
# WHERE ((a ILIKE '%test%') OR (a ILIKE 'foo')
|
28
|
-
# OR (b ILIKE '%test%') OR (b ILIKE 'foo'))
|
29
|
-
|
30
|
-
* When using the schema plugin, you can now provide a block to the
|
31
|
-
create_table methods to set the schema and create the table
|
32
|
-
in the same call:
|
33
|
-
|
34
|
-
class Artist < Sequel::Model
|
35
|
-
create_table do
|
36
|
-
primary_key :id
|
37
|
-
String :name
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
* The tree plugin now accepts a :single_root option, which uses a
|
42
|
-
before_save hook to attempt to ensure that there is only a single
|
43
|
-
root in the tree. It also adds a Model.root method to get the
|
44
|
-
single root of the tree.
|
45
|
-
|
46
|
-
* The tree plugin now adds a Model#root? instance method to check
|
47
|
-
if the current node is a root of the tree.
|
48
|
-
|
49
|
-
* Model#save now takes a :raise_on_failure option which will
|
50
|
-
override the object's raise_on_save_failure setting. This makes
|
51
|
-
it easier to get the desired behavior (raise or just return false)
|
52
|
-
in library code without using a begin/ensure block.
|
53
|
-
|
54
|
-
* The Database#adapter_scheme instance method was added, which
|
55
|
-
operates the same as the class method.
|
56
|
-
|
57
|
-
* Sequel now handles the literalization of OCI8::CLOB objects in
|
58
|
-
the Oracle adapter.
|
59
|
-
|
60
|
-
= Other Improvements
|
61
|
-
|
62
|
-
* When using the timezone support, Sequel will now correctly load
|
63
|
-
times and datetimes in standard time when the current timezone is
|
64
|
-
in daylight time, or vice versa. Previously, if you tried to
|
65
|
-
to load a time or datetime in December when in July in a timezone
|
66
|
-
that used daylight time, it would be off by an hour.
|
67
|
-
|
68
|
-
* The rcte_tree plugin now works correctly when a :conditions option
|
69
|
-
is used.
|
70
|
-
|
71
|
-
* The single_table_inheritance plugin now works correctly when the
|
72
|
-
class discriminator column has the same name as an existing ruby
|
73
|
-
method (such as type).
|
74
|
-
|
75
|
-
* Database#each_server now works correctly when a connection string
|
76
|
-
is used to connect, instead of an options hash.
|
77
|
-
|
78
|
-
* Model#destroy now respects the object's use_transactions setting,
|
79
|
-
instead of always using a transaction.
|
80
|
-
|
81
|
-
* Model#exists? now uses a simpler and faster query.
|
82
|
-
|
83
|
-
* Sequel now handles the aggregate methods such as count and sum
|
84
|
-
correctly on Microsoft SQL Server when using an ordered dataset
|
85
|
-
with a clause such as DISTINCT or GROUP and without a limit.
|
86
|
-
|
87
|
-
* Sequel now handles rename_table correctly on Microsoft SQL Server
|
88
|
-
when using a case sensitive collation, or when qualifying the
|
89
|
-
table with a schema.
|
90
|
-
|
91
|
-
* Sequel now parses the schema correctly on Oracle when the same
|
92
|
-
table name is used in multiple schemas.
|
93
|
-
|
94
|
-
* Sequel now handles OCIInvalidHandle errors when disconnecting
|
95
|
-
in the Oracle adapter.
|
96
|
-
|
97
|
-
* Sequel now raises a Sequel::Error instead of an ArgumentError
|
98
|
-
if the current or target migration version does not exist.
|
99
|
-
|
100
|
-
* When a mismatched number of composite keys are used in
|
101
|
-
associations, Sequel now uses a more detailed error message.
|
102
|
-
|
103
|
-
* Significant improvements were made to the Dataset and Model
|
104
|
-
RDoc documentation.
|
105
|
-
|
106
|
-
= Backwards Compatibility
|
107
|
-
|
108
|
-
* Model#valid? now must accept an optional options hash.
|
109
|
-
|
110
|
-
* The Model#save_failure private method was renamed to
|
111
|
-
raise_hook_failure.
|
112
|
-
|
113
|
-
* The LOCAL_DATETIME_OFFSET_SECS and LOCAL_DATETIME_OFFSET constants
|
114
|
-
have been removed from the Sequel module.
|
115
|
-
|
116
|
-
* Sequel now uses obj.to_json instead of JSON.generate(obj). This
|
117
|
-
shouldn't affect backwards compatibility, but did fix a bug in
|
118
|
-
certain cases.
|
@@ -1,78 +0,0 @@
|
|
1
|
-
= Performance Enhancements
|
2
|
-
|
3
|
-
* A mysql2 adapter was added to Sequel. It offers a large (2-6x)
|
4
|
-
performance increase over the standard mysql adapter. In order to
|
5
|
-
use it, you need to install mysql2, and change your connection
|
6
|
-
strings to use mysql2:// instead of mysql://.
|
7
|
-
|
8
|
-
* Support for sequel_pg was added to the native postgres adapter,
|
9
|
-
when pg is being used as the backend. sequel_pg also offers a
|
10
|
-
large (2-6x) performance increase over the default row fetching
|
11
|
-
code that the Sequel postgres adapter uses. In order to use it,
|
12
|
-
you just need to install sequel_pg, and the postgres adapter will
|
13
|
-
pick it up automatically.
|
14
|
-
|
15
|
-
* Mass assignment has been made about 10x faster by caching the
|
16
|
-
allowed setter methods in the model.
|
17
|
-
|
18
|
-
= Other Improvements
|
19
|
-
|
20
|
-
* The following construct is now safe to use in environments that
|
21
|
-
reload code without unloading existing constants:
|
22
|
-
|
23
|
-
class MyModel < Sequel::Model(DB[:table])
|
24
|
-
end
|
25
|
-
|
26
|
-
Previously, this would raise a superclass mismatch TypeError.
|
27
|
-
|
28
|
-
* Sequel now handles the case where both an implicit and an explicit
|
29
|
-
table alias are given to join_table, preferring the explicit alias.
|
30
|
-
This can happen if you are using models with aliased table names
|
31
|
-
and eager graphing them. Previously, this would result in invalid
|
32
|
-
SQL, with both aliases being used.
|
33
|
-
|
34
|
-
* You can use use an aliased table for the :join_table option
|
35
|
-
of a many_to_many association.
|
36
|
-
|
37
|
-
* The active_model plugin now supports the final release of
|
38
|
-
ActiveModel 3.0.0.
|
39
|
-
|
40
|
-
* Typecasting now works correctly for attributes loaded lazily
|
41
|
-
when using the lazy_attributes plugin.
|
42
|
-
|
43
|
-
* The class_table_inheritance plugin now works with non-integer
|
44
|
-
primary keys on SQLite.
|
45
|
-
|
46
|
-
* Temporary tables are now ignored when parsing the schema on
|
47
|
-
PostgreSQL.
|
48
|
-
|
49
|
-
* On MySQL, an :auto_increment key with a true value is added to
|
50
|
-
the Database#schema output hash if the related column is
|
51
|
-
auto incrementing.
|
52
|
-
|
53
|
-
* The mysql adapter now handles Mysql::Error exceptions raised when
|
54
|
-
disconnecting.
|
55
|
-
|
56
|
-
* On SQLite, emulated alter_table commands that require dropping
|
57
|
-
the table now preserve the foreign key information, if SQLite
|
58
|
-
foreign key support is enabled (it is by default).
|
59
|
-
|
60
|
-
* DSN-less connections now work correctly in more cases in the
|
61
|
-
ODBC adapter.
|
62
|
-
|
63
|
-
* A workaround has been added for a bug in the Microsoft SQL
|
64
|
-
Server JDBC Driver 3.0, involving it incorrectly returning a
|
65
|
-
smallint instead of a char type for the IS_AUTOINCREMENT
|
66
|
-
metadata value.
|
67
|
-
|
68
|
-
* An bug in the error handling when connecting to PostgreSQL using
|
69
|
-
the do (DataObjects) adapter has been fixed.
|
70
|
-
|
71
|
-
= Backwards Compatibility
|
72
|
-
|
73
|
-
* The caching of allowed mass assignment methods can result in the
|
74
|
-
incorrect exception class being raised if you manually undefine
|
75
|
-
instance setter methods in the model class. If you do this, you
|
76
|
-
need to clear the setter methods cache manually:
|
77
|
-
|
78
|
-
MyModel.clear_setter_methods_cache
|
@@ -1,45 +0,0 @@
|
|
1
|
-
= New Adapter
|
2
|
-
|
3
|
-
* A swift adapter was added to Sequel. Swift is a relatively new
|
4
|
-
ruby database library, built on top of a relatively new backend
|
5
|
-
called dbic++. While not yet considered production ready, it is
|
6
|
-
very fast. The swift adapter is about 33% faster and 40% more
|
7
|
-
memory efficient for selects than the postgres adapter using pg
|
8
|
-
with sequel_pg, though it is slower and less memory efficient
|
9
|
-
for inserts and updates.
|
10
|
-
|
11
|
-
Sequel's swift adapter currently supports only PostgreSQL and
|
12
|
-
MySQL, but support for other databases will probably be added in
|
13
|
-
the future.
|
14
|
-
|
15
|
-
= Other Improvements
|
16
|
-
|
17
|
-
* Sequel now correctly literalizes DateTime objects on ruby 1.9 for
|
18
|
-
databases that support fractional seconds.
|
19
|
-
|
20
|
-
* The identity_map plugin now handles composite keys in many_to_one
|
21
|
-
associations.
|
22
|
-
|
23
|
-
* The rcte_tree plugin now works when the model's dataset does not
|
24
|
-
select all columns. This can happen when using the lazy_attributes
|
25
|
-
plugin on the same model.
|
26
|
-
|
27
|
-
* Sequel now supports INTERSECT and EXCEPT on Microsoft SQL Server
|
28
|
-
2005+.
|
29
|
-
|
30
|
-
* The Database#create_language method in the shared PostgreSQL
|
31
|
-
adapter now accepts a :replace option to replace the currently
|
32
|
-
loaded procedural language if it already exists. This option
|
33
|
-
is ignored for PostgreSQL versions before 9.0.
|
34
|
-
|
35
|
-
* The identity_map plugin now handles cases where the plugin is
|
36
|
-
loaded separately by two different models.
|
37
|
-
|
38
|
-
= Backwards Compatibility
|
39
|
-
|
40
|
-
* While not technically backwards compatibility related, it was
|
41
|
-
discovered that the identity_map plugin is incompatible with
|
42
|
-
the standard eager loading of many_to_many and many_through_many
|
43
|
-
associations. If you want to eagerly load those associations and
|
44
|
-
use the identity_map plugin, you should use eager_graph instead
|
45
|
-
of eager.
|
@@ -1,58 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* You can now change the level at which Sequel logs SQL statements,
|
4
|
-
by calling Database#sql_log_level= with the method name symbol.
|
5
|
-
The default is still :info for backwards compatibility. Previously,
|
6
|
-
you had to use a proxy logger to get similar capability.
|
7
|
-
|
8
|
-
* You can now specify graph aliases where the alias would be the same
|
9
|
-
as the table column name using just the table name symbol, instead
|
10
|
-
having to repeat the alias as the second element of an array. More
|
11
|
-
clearly:
|
12
|
-
|
13
|
-
# < 3.17.0:
|
14
|
-
DB[:a].graph(:b, :a_id=>:id).
|
15
|
-
set_graph_aliases(:c=>[:a, :c], :d=>[:b, :d])
|
16
|
-
# >= 3.17.0:
|
17
|
-
DB[:a].graph(:b, :a_id=>:id).set_graph_aliases(:c=>:a, :d=>:b)
|
18
|
-
|
19
|
-
Both of these now yield the SQL:
|
20
|
-
|
21
|
-
SELECT a.c, b.d FROM a LEFT OUTER JOIN b ON (b.a_id = a.id)
|
22
|
-
|
23
|
-
* You should now be able to connect to MySQL over SSL in the native
|
24
|
-
MySQL adapter using the :sslca, :sslkey, and related options.
|
25
|
-
|
26
|
-
* Database#views and Database#view_exists? methods were added to the
|
27
|
-
Oracle adapter, allowing you to get a an array of view name symbols
|
28
|
-
and to check whether a given view exists.
|
29
|
-
|
30
|
-
= Other Improvements
|
31
|
-
|
32
|
-
* The nested_attributes plugin now avoids unnecessary update calls
|
33
|
-
when deleting associated objects, resulting in better performance.
|
34
|
-
|
35
|
-
* The optimistic_locking plugin now increments the lock column if no
|
36
|
-
other columns were modified but the Model#modified! was called. This
|
37
|
-
means it now works correctly with the nested_attributes plugin when
|
38
|
-
no changes to the main model object are made.
|
39
|
-
|
40
|
-
* The xml_serializer plugin can now round-trip nil values correctly.
|
41
|
-
Previously, nil values would be converted into empty strings. This
|
42
|
-
is accomplished by including a nil attribute in the xml tag.
|
43
|
-
|
44
|
-
* Database#each_server now works correctly when using the jdbc and do
|
45
|
-
adapters and a connection string without a separate :adapter option.
|
46
|
-
|
47
|
-
* You can now clone many_through_many associations.
|
48
|
-
|
49
|
-
* The default wait_timeout used by the mysql and mysql2 adapters was
|
50
|
-
decreased slightly so that it works correctly with MySQL database
|
51
|
-
servers that run on Windows.
|
52
|
-
|
53
|
-
* Many improvements were made to the AS400 jdbc subadapter.
|
54
|
-
|
55
|
-
* Many improvements were made to the swift adapter and subadapters.
|
56
|
-
|
57
|
-
* Dataset#ungraphed now removes any cached graph aliases set with
|
58
|
-
set_graph_aliases or add_graph_aliases.
|
@@ -1,120 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* Reversible migration support has been added:
|
4
|
-
|
5
|
-
Sequel.migration do
|
6
|
-
change do
|
7
|
-
create_table(:artists) do
|
8
|
-
primary_key :id
|
9
|
-
String :name, :null=>false
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
The change block acts the same way as an up block, except that
|
15
|
-
it automatically creates a down block that reverses the changes.
|
16
|
-
So the above is equivalent to:
|
17
|
-
|
18
|
-
Sequel.migration do
|
19
|
-
up do
|
20
|
-
create_table(:artists) do
|
21
|
-
primary_key :id
|
22
|
-
String :name, :null=>false
|
23
|
-
end
|
24
|
-
end
|
25
|
-
down do
|
26
|
-
drop_table :artists
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
The following methods are supported in a change block:
|
31
|
-
|
32
|
-
* create_table
|
33
|
-
* add_column
|
34
|
-
* add_index
|
35
|
-
* rename_column
|
36
|
-
* rename_table
|
37
|
-
* alter_table (supporting the following methods):
|
38
|
-
* add_column
|
39
|
-
* add_constraint
|
40
|
-
* add_foreign_key (with a symbol, not an array)
|
41
|
-
* add_primary_key (with a symbol, not an array)
|
42
|
-
* add_index
|
43
|
-
* add_full_text_index
|
44
|
-
* add_spatial_index
|
45
|
-
* rename_column
|
46
|
-
|
47
|
-
Use of an other method in a change block will result in the
|
48
|
-
creation of a down block that raises an exception.
|
49
|
-
|
50
|
-
* A to_dot extension has been added that adds a Dataset#to_dot
|
51
|
-
method, which returns a string that can be used as input to
|
52
|
-
the graphviz dot program in order to create visualizations
|
53
|
-
of the dataset's abstract syntax tree. Examples:
|
54
|
-
|
55
|
-
* http://sequel.jeremyevans.net/images/to_dot_simple.gif
|
56
|
-
* http://sequel.jeremyevans.net/images/to_dot_complex.gif
|
57
|
-
|
58
|
-
Both the to_dot extension and reversible migrations support
|
59
|
-
were inspired by Aaron Patterson's recent work on ActiveRecord
|
60
|
-
and ARel.
|
61
|
-
|
62
|
-
* The user can now control how the connection pool handles attempts
|
63
|
-
to access shards that haven't been configured. The default is
|
64
|
-
still to assume the :default shard. However, you can specify a
|
65
|
-
different shard using the :servers_hash option when connecting
|
66
|
-
to the database:
|
67
|
-
|
68
|
-
DB = Sequel.connect(..., :servers_hash=>Hash.new(:some_shard))
|
69
|
-
|
70
|
-
You can also use this feature to raise an exception if an
|
71
|
-
unconfigured shard is used:
|
72
|
-
|
73
|
-
DB = Sequel.connect(..., :servers_hash=>Hash.new{raise ...})
|
74
|
-
|
75
|
-
* The mysql and mysql2 adapters now both support the :read_timeout
|
76
|
-
and :connect_timeout options. read_timeout is the timeout in
|
77
|
-
seconds for reading back results of a query, and connect_timeout
|
78
|
-
is the timeout in seconds before a connection attempt is abandoned.
|
79
|
-
|
80
|
-
= Other Improvements
|
81
|
-
|
82
|
-
* The json_serializer plugin will now typecast column values for
|
83
|
-
columns with unrestricted setter methods when parsing JSON into
|
84
|
-
model objects. It now also calls the getter method when creating
|
85
|
-
the JSON, instead of directly taking the values from the underlying
|
86
|
-
hash.
|
87
|
-
|
88
|
-
* When parsing the schema for a model with an aliased table name,
|
89
|
-
the unaliased table name is now used.
|
90
|
-
|
91
|
-
* The SQLite adapter has been updated to not rely on the native
|
92
|
-
type_translation support, since that will be removed in the next
|
93
|
-
major version of sqlite3-ruby. Sequel now implements it's own
|
94
|
-
type translation in the sqlite adapter, similarly to how the mysql
|
95
|
-
and postgres adapters handle type translation.
|
96
|
-
|
97
|
-
* On SQLite, when emulating natively unsupported schema methods such
|
98
|
-
as drop_column, Sequel will now attempt to recreate applicable
|
99
|
-
indexes on the underlying table.
|
100
|
-
|
101
|
-
* A more informative error message is now used when connecting fails
|
102
|
-
when using the jdbc adapter.
|
103
|
-
|
104
|
-
* method_missing is no longer removed from Sequel::BasicObject on
|
105
|
-
ruby 1.8. This should improve compatibility in some cases with
|
106
|
-
Rubinius.
|
107
|
-
|
108
|
-
= Backwards Compatibility
|
109
|
-
|
110
|
-
* On SQLite, Sequel no longer assumes that a plain integer in a
|
111
|
-
datetime or timestamp field represents a unix epoch time.
|
112
|
-
|
113
|
-
* Previously, saving a model object that used the instance_hooks
|
114
|
-
plugin removed all instance hooks. Now, only the applicable hooks
|
115
|
-
are removed. So if you save a new object, the update instance
|
116
|
-
hooks won't be removed. And if you save an existing object, delete
|
117
|
-
instance hooks won't be removed.
|
118
|
-
|
119
|
-
* The private Dataset#identifier_list method has been moved into the
|
120
|
-
SQLite adapter, since that is the only place it was used.
|
@@ -1,67 +0,0 @@
|
|
1
|
-
= New Features
|
2
|
-
|
3
|
-
* The add_* association methods now accept a primary key, and
|
4
|
-
associates the receiver to the associated model object with that
|
5
|
-
primary key:
|
6
|
-
|
7
|
-
artist.add_album(42)
|
8
|
-
# equivalent to: artist.add_album(Album[42])
|
9
|
-
|
10
|
-
* The validation_class_methods plugin now has the ability to
|
11
|
-
reflect on validations:
|
12
|
-
|
13
|
-
Album.plugin :validation_class_methods
|
14
|
-
Album.validates_acceptance_of(:a)
|
15
|
-
Album.validation_reflections
|
16
|
-
# => {:a=>[[:acceptance, {:tag=>:acceptance, :allow_nil=>true,
|
17
|
-
:message=>"is not accepted", :accept=>"1"}]]}
|
18
|
-
|
19
|
-
= Other Improvements
|
20
|
-
|
21
|
-
* In the postgres, mysql, and sqlite adapters, typecasting now uses
|
22
|
-
methods instead of procs. Since methods aren't closures (while
|
23
|
-
procs are), this makes typecasting faster (up to 15%).
|
24
|
-
|
25
|
-
* When typecasting model column values, the classes of the new and
|
26
|
-
existing values are checked in addition to the values themselves.
|
27
|
-
Previously, if the new and existing values were equal (i.e. 1.0
|
28
|
-
and 1), it wouldn't update the value. Now, if the classes are
|
29
|
-
different, it always updates the value.
|
30
|
-
|
31
|
-
* Date and DateTime objects are now handled correctly when using
|
32
|
-
prepared statements/bound variables in the jdbc adapter.
|
33
|
-
|
34
|
-
* Date, DateTime, Time, true, false, and SQL::Blob objects are now
|
35
|
-
handled correctly when using prepared statements/bound variables
|
36
|
-
in the sqlite adapter.
|
37
|
-
|
38
|
-
* Sequel now uses varbinary(max) instead of image for the generic
|
39
|
-
File (blob) type on Microsoft SQL Server. This makes it possible
|
40
|
-
to use an SQL::Blob object as a prepared statement argument.
|
41
|
-
|
42
|
-
* Sequel now handles blobs better in the Amalgalite adapter.
|
43
|
-
|
44
|
-
* When disconnecting a connection using the sqlite adapter, all
|
45
|
-
open prepared statements are now closed first. Previously,
|
46
|
-
attempting to disconnect a connection with open prepared statements
|
47
|
-
resulted in an error.
|
48
|
-
|
49
|
-
* The license file has been renamed from COPYING to MIT-LICENSE, to
|
50
|
-
make it easier to determine at a glance which license is used.
|
51
|
-
|
52
|
-
= Backwards Compatibility
|
53
|
-
|
54
|
-
* Because Sequel switched the generic File type from image to
|
55
|
-
varbinary(max) on Microsoft SQL Server, any migrations/schema
|
56
|
-
modification methods that used the File type will now result in a
|
57
|
-
different column type than before.
|
58
|
-
|
59
|
-
* The MYSQL_TYPE_PROCS, PG_TYPE_PROCS, and SQLITE_TYPE_PROCS
|
60
|
-
constants have been removed from the mysql, postgres, and sqlite
|
61
|
-
adapters, respectively. The UNIX_EPOCH_TIME_FORMAT and
|
62
|
-
FALSE_VALUES constants have also been removed from the sqlite
|
63
|
-
adapter.
|
64
|
-
|
65
|
-
* Typecasting in the sqlite adapters now uses to_i and to_f instead
|
66
|
-
of Integer() and Float() with rescues. If you put non-numeric
|
67
|
-
data in numeric columns on SQLite, this could cause problems.
|