sequel 3.21.0 → 3.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +485 -3
- data/README.rdoc +20 -6
- data/Rakefile +37 -19
- data/bin/sequel +1 -5
- data/doc/association_basics.rdoc +249 -43
- data/doc/dataset_basics.rdoc +4 -4
- data/doc/dataset_filtering.rdoc +8 -0
- data/doc/mass_assignment.rdoc +54 -0
- data/doc/migration.rdoc +15 -538
- data/doc/model_hooks.rdoc +72 -27
- data/doc/opening_databases.rdoc +89 -50
- data/doc/prepared_statements.rdoc +40 -13
- data/doc/reflection.rdoc +8 -2
- data/doc/release_notes/3.22.0.txt +39 -0
- data/doc/release_notes/3.23.0.txt +172 -0
- data/doc/release_notes/3.24.0.txt +420 -0
- data/doc/release_notes/3.25.0.txt +88 -0
- data/doc/release_notes/3.26.0.txt +88 -0
- data/doc/release_notes/3.27.0.txt +82 -0
- data/doc/release_notes/3.28.0.txt +304 -0
- data/doc/release_notes/3.29.0.txt +459 -0
- data/doc/release_notes/3.30.0.txt +135 -0
- data/doc/release_notes/3.31.0.txt +146 -0
- data/doc/schema_modification.rdoc +547 -0
- data/doc/sharding.rdoc +7 -1
- data/doc/testing.rdoc +129 -0
- data/doc/transactions.rdoc +137 -0
- data/doc/virtual_rows.rdoc +2 -2
- data/lib/sequel/adapters/ado/mssql.rb +18 -6
- data/lib/sequel/adapters/ado.rb +40 -18
- data/lib/sequel/adapters/amalgalite.rb +17 -9
- data/lib/sequel/adapters/db2.rb +175 -86
- data/lib/sequel/adapters/dbi.rb +15 -15
- data/lib/sequel/adapters/do/mysql.rb +5 -7
- data/lib/sequel/adapters/do/postgres.rb +0 -5
- data/lib/sequel/adapters/do/sqlite.rb +0 -5
- data/lib/sequel/adapters/do.rb +17 -36
- data/lib/sequel/adapters/firebird.rb +27 -208
- data/lib/sequel/adapters/ibmdb.rb +448 -0
- data/lib/sequel/adapters/informix.rb +6 -23
- data/lib/sequel/adapters/jdbc/as400.rb +16 -34
- data/lib/sequel/adapters/jdbc/db2.rb +45 -0
- data/lib/sequel/adapters/jdbc/derby.rb +247 -0
- data/lib/sequel/adapters/jdbc/firebird.rb +29 -0
- data/lib/sequel/adapters/jdbc/h2.rb +56 -29
- data/lib/sequel/adapters/jdbc/hsqldb.rb +170 -0
- data/lib/sequel/adapters/jdbc/informix.rb +26 -0
- data/lib/sequel/adapters/jdbc/jtds.rb +34 -0
- data/lib/sequel/adapters/jdbc/mssql.rb +3 -33
- data/lib/sequel/adapters/jdbc/mysql.rb +11 -11
- data/lib/sequel/adapters/jdbc/oracle.rb +81 -25
- data/lib/sequel/adapters/jdbc/postgresql.rb +9 -13
- data/lib/sequel/adapters/jdbc/sqlite.rb +2 -6
- data/lib/sequel/adapters/jdbc/sqlserver.rb +71 -0
- data/lib/sequel/adapters/jdbc/transactions.rb +83 -0
- data/lib/sequel/adapters/jdbc.rb +231 -78
- data/lib/sequel/adapters/mock.rb +335 -0
- data/lib/sequel/adapters/mysql.rb +82 -184
- data/lib/sequel/adapters/mysql2.rb +26 -25
- data/lib/sequel/adapters/odbc/db2.rb +17 -0
- data/lib/sequel/adapters/odbc/mssql.rb +1 -6
- data/lib/sequel/adapters/odbc.rb +28 -9
- data/lib/sequel/adapters/openbase.rb +3 -5
- data/lib/sequel/adapters/oracle.rb +351 -53
- data/lib/sequel/adapters/postgres.rb +194 -33
- data/lib/sequel/adapters/shared/access.rb +32 -9
- data/lib/sequel/adapters/shared/db2.rb +321 -0
- data/lib/sequel/adapters/shared/firebird.rb +221 -0
- data/lib/sequel/adapters/shared/informix.rb +53 -0
- data/lib/sequel/adapters/shared/mssql.rb +231 -106
- data/lib/sequel/adapters/shared/mysql.rb +181 -63
- data/lib/sequel/adapters/shared/mysql_prepared_statements.rb +149 -0
- data/lib/sequel/adapters/shared/oracle.rb +231 -41
- data/lib/sequel/adapters/shared/postgres.rb +214 -82
- data/lib/sequel/adapters/shared/progress.rb +4 -7
- data/lib/sequel/adapters/shared/sqlite.rb +201 -57
- data/lib/sequel/adapters/sqlite.rb +29 -21
- data/lib/sequel/adapters/swift/mysql.rb +12 -7
- data/lib/sequel/adapters/swift/postgres.rb +0 -5
- data/lib/sequel/adapters/swift/sqlite.rb +8 -6
- data/lib/sequel/adapters/swift.rb +5 -5
- data/lib/sequel/adapters/tinytds.rb +160 -19
- data/lib/sequel/adapters/utils/emulate_offset_with_row_number.rb +66 -0
- data/lib/sequel/adapters/utils/stored_procedures.rb +1 -11
- data/lib/sequel/ast_transformer.rb +190 -0
- data/lib/sequel/connection_pool/threaded.rb +3 -2
- data/lib/sequel/connection_pool.rb +1 -1
- data/lib/sequel/core.rb +46 -5
- data/lib/sequel/database/connecting.rb +5 -6
- data/lib/sequel/database/dataset.rb +4 -4
- data/lib/sequel/database/dataset_defaults.rb +59 -1
- data/lib/sequel/database/logging.rb +1 -1
- data/lib/sequel/database/misc.rb +104 -19
- data/lib/sequel/database/query.rb +153 -58
- data/lib/sequel/database/schema_generator.rb +17 -7
- data/lib/sequel/database/schema_methods.rb +59 -29
- data/lib/sequel/dataset/actions.rb +231 -76
- data/lib/sequel/dataset/features.rb +91 -8
- data/lib/sequel/dataset/graph.rb +38 -11
- data/lib/sequel/dataset/misc.rb +50 -23
- data/lib/sequel/dataset/mutation.rb +5 -6
- data/lib/sequel/dataset/prepared_statements.rb +48 -27
- data/lib/sequel/dataset/query.rb +236 -43
- data/lib/sequel/dataset/sql.rb +665 -253
- data/lib/sequel/dataset.rb +8 -0
- data/lib/sequel/exceptions.rb +4 -0
- data/lib/sequel/extensions/columns_introspection.rb +61 -0
- data/lib/sequel/extensions/migration.rb +6 -4
- data/lib/sequel/extensions/named_timezones.rb +5 -0
- data/lib/sequel/extensions/thread_local_timezones.rb +1 -1
- data/lib/sequel/extensions/to_dot.rb +95 -83
- data/lib/sequel/model/associations.rb +1020 -337
- data/lib/sequel/model/base.rb +414 -132
- data/lib/sequel/model/errors.rb +1 -1
- data/lib/sequel/model/exceptions.rb +5 -1
- data/lib/sequel/model.rb +15 -8
- data/lib/sequel/plugins/association_pks.rb +22 -4
- data/lib/sequel/plugins/class_table_inheritance.rb +4 -4
- data/lib/sequel/plugins/dataset_associations.rb +100 -0
- data/lib/sequel/plugins/defaults_setter.rb +58 -0
- data/lib/sequel/plugins/force_encoding.rb +6 -6
- data/lib/sequel/plugins/identity_map.rb +114 -7
- data/lib/sequel/plugins/many_through_many.rb +65 -7
- data/lib/sequel/plugins/prepared_statements.rb +151 -0
- data/lib/sequel/plugins/prepared_statements_associations.rb +84 -0
- data/lib/sequel/plugins/prepared_statements_safe.rb +82 -0
- data/lib/sequel/plugins/prepared_statements_with_pk.rb +59 -0
- data/lib/sequel/plugins/rcte_tree.rb +29 -15
- data/lib/sequel/plugins/serialization.rb +88 -44
- data/lib/sequel/plugins/serialization_modification_detection.rb +51 -0
- data/lib/sequel/plugins/sharding.rb +21 -54
- data/lib/sequel/plugins/single_table_inheritance.rb +3 -1
- data/lib/sequel/plugins/typecast_on_load.rb +9 -12
- data/lib/sequel/plugins/update_primary_key.rb +2 -2
- data/lib/sequel/plugins/xml_serializer.rb +3 -3
- data/lib/sequel/sql.rb +109 -52
- data/lib/sequel/timezones.rb +57 -38
- data/lib/sequel/version.rb +1 -1
- data/spec/adapters/db2_spec.rb +146 -0
- data/spec/adapters/mssql_spec.rb +111 -29
- data/spec/adapters/mysql_spec.rb +135 -123
- data/spec/adapters/oracle_spec.rb +49 -77
- data/spec/adapters/postgres_spec.rb +267 -78
- data/spec/adapters/spec_helper.rb +6 -5
- data/spec/adapters/sqlite_spec.rb +35 -21
- data/spec/core/connection_pool_spec.rb +71 -92
- data/spec/core/core_sql_spec.rb +21 -30
- data/spec/core/database_spec.rb +788 -512
- data/spec/core/dataset_spec.rb +1073 -1053
- data/spec/core/expression_filters_spec.rb +159 -42
- data/spec/core/mock_adapter_spec.rb +419 -0
- data/spec/core/object_graph_spec.rb +86 -114
- data/spec/core/schema_generator_spec.rb +3 -3
- data/spec/core/schema_spec.rb +298 -38
- data/spec/core/spec_helper.rb +6 -48
- data/spec/extensions/association_autoreloading_spec.rb +1 -10
- data/spec/extensions/association_dependencies_spec.rb +2 -12
- data/spec/extensions/association_pks_spec.rb +66 -32
- data/spec/extensions/caching_spec.rb +23 -50
- data/spec/extensions/class_table_inheritance_spec.rb +31 -83
- data/spec/extensions/columns_introspection_spec.rb +91 -0
- data/spec/extensions/composition_spec.rb +18 -13
- data/spec/extensions/dataset_associations_spec.rb +199 -0
- data/spec/extensions/defaults_setter_spec.rb +64 -0
- data/spec/extensions/hook_class_methods_spec.rb +65 -91
- data/spec/extensions/identity_map_spec.rb +114 -22
- data/spec/extensions/instance_filters_spec.rb +11 -21
- data/spec/extensions/instance_hooks_spec.rb +53 -0
- data/spec/extensions/json_serializer_spec.rb +4 -5
- data/spec/extensions/lazy_attributes_spec.rb +16 -20
- data/spec/extensions/list_spec.rb +17 -39
- data/spec/extensions/many_through_many_spec.rb +283 -250
- data/spec/extensions/migration_spec.rb +35 -32
- data/spec/extensions/named_timezones_spec.rb +23 -3
- data/spec/extensions/nested_attributes_spec.rb +97 -88
- data/spec/extensions/optimistic_locking_spec.rb +9 -20
- data/spec/extensions/prepared_statements_associations_spec.rb +111 -0
- data/spec/extensions/prepared_statements_safe_spec.rb +61 -0
- data/spec/extensions/prepared_statements_spec.rb +53 -0
- data/spec/extensions/prepared_statements_with_pk_spec.rb +31 -0
- data/spec/extensions/pretty_table_spec.rb +1 -6
- data/spec/extensions/rcte_tree_spec.rb +41 -43
- data/spec/extensions/schema_dumper_spec.rb +5 -8
- data/spec/extensions/schema_spec.rb +13 -21
- data/spec/extensions/serialization_modification_detection_spec.rb +37 -0
- data/spec/extensions/serialization_spec.rb +72 -43
- data/spec/extensions/sharding_spec.rb +66 -140
- data/spec/extensions/single_table_inheritance_spec.rb +18 -29
- data/spec/extensions/spec_helper.rb +13 -61
- data/spec/extensions/sql_expr_spec.rb +20 -60
- data/spec/extensions/tactical_eager_loading_spec.rb +9 -19
- data/spec/extensions/thread_local_timezones_spec.rb +22 -2
- data/spec/extensions/timestamps_spec.rb +6 -6
- data/spec/extensions/to_dot_spec.rb +4 -7
- data/spec/extensions/touch_spec.rb +13 -14
- data/spec/extensions/tree_spec.rb +11 -26
- data/spec/extensions/typecast_on_load_spec.rb +1 -6
- data/spec/extensions/update_primary_key_spec.rb +30 -24
- data/spec/extensions/validation_class_methods_spec.rb +30 -51
- data/spec/extensions/validation_helpers_spec.rb +16 -35
- data/spec/extensions/xml_serializer_spec.rb +16 -4
- data/spec/integration/associations_test.rb +537 -21
- data/spec/integration/database_test.rb +4 -2
- data/spec/integration/dataset_test.rb +461 -65
- data/spec/integration/eager_loader_test.rb +19 -21
- data/spec/integration/model_test.rb +80 -1
- data/spec/integration/plugin_test.rb +304 -116
- data/spec/integration/prepared_statement_test.rb +212 -122
- data/spec/integration/schema_test.rb +161 -30
- data/spec/integration/spec_helper.rb +39 -30
- data/spec/integration/timezone_test.rb +38 -12
- data/spec/integration/transaction_test.rb +172 -5
- data/spec/integration/type_test.rb +17 -3
- data/spec/model/association_reflection_spec.rb +201 -7
- data/spec/model/associations_spec.rb +865 -662
- data/spec/model/base_spec.rb +275 -95
- data/spec/model/dataset_methods_spec.rb +7 -27
- data/spec/model/eager_loading_spec.rb +677 -676
- data/spec/model/hooks_spec.rb +309 -67
- data/spec/model/model_spec.rb +222 -168
- data/spec/model/plugins_spec.rb +24 -13
- data/spec/model/record_spec.rb +381 -218
- data/spec/model/spec_helper.rb +13 -71
- data/spec/model/validations_spec.rb +11 -0
- metadata +115 -73
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,485 @@
|
|
|
1
|
+
=== 3.31.0 (2012-01-03)
|
|
2
|
+
|
|
3
|
+
* Dataset#from no longer handles :a__b__c___d as a.b.c AS d (jeremyevans)
|
|
4
|
+
|
|
5
|
+
* Support many_to_one associations with the same name as their column, using the :key_column option (jeremyevans)
|
|
6
|
+
|
|
7
|
+
* Add Model.def_column_alias for defining alias methods for columns (jeremyevans)
|
|
8
|
+
|
|
9
|
+
* Support :server option in Dataset#import and #multi_insert (jeremyevans)
|
|
10
|
+
|
|
11
|
+
* Respect existing RETURNING/OUTPUT clauses in #import/#multi_insert on PostgreSQL/MSSQL (jeremyevans)
|
|
12
|
+
|
|
13
|
+
* Support :return=>:primary_key option to Dataset#import and #multi_insert (jeremyevans)
|
|
14
|
+
|
|
15
|
+
* Correctly handle return value for Dataset#insert with column array and value array on PostgreSQL <8.2 (jeremyevans)
|
|
16
|
+
|
|
17
|
+
* Dataset#insert_multiple now returns an array of inserted primary keys (jeremyevans) (#408)
|
|
18
|
+
|
|
19
|
+
* Support RETURNING with DELETE and UPDATE on PostgreSQL 8.2+ (funny-falcon)
|
|
20
|
+
|
|
21
|
+
* Raise error if tables from two separate schema are detected when parsing the schema for a single table on PostgreSQL (jeremyevans)
|
|
22
|
+
|
|
23
|
+
* Handle clob types as string instead of blob on H2 (jeremyevans)
|
|
24
|
+
|
|
25
|
+
* Add database type support to the mock adapter, e.g. mock://postgres (jeremyevans)
|
|
26
|
+
|
|
27
|
+
* Allow creation of full text indexes on Microsoft SQL Server, but you need to provide a :key_index option (jeremyevans)
|
|
28
|
+
|
|
29
|
+
* Allow Dataset#full_text_search usage with prepared statements (jeremyevans)
|
|
30
|
+
|
|
31
|
+
* Make Dataset#exists use a PlaceholderLiteralString so it works with prepared statements (jeremyevans)
|
|
32
|
+
|
|
33
|
+
* Fix Dataset#empty? for datasets with offsets when offset support is emulated (jeremyevans)
|
|
34
|
+
|
|
35
|
+
* Add Dataset#group_rollup and #group_cube methods for GROUP BY ROLLUP and CUBE support (jeremyevans)
|
|
36
|
+
|
|
37
|
+
* Add support for custom serialization formats to the serialization plugin (jeremyevans)
|
|
38
|
+
|
|
39
|
+
* Support a :login_timeout option in the jdbc adapter (glebpom) (#406)
|
|
40
|
+
|
|
41
|
+
=== 3.30.0 (2011-12-01)
|
|
42
|
+
|
|
43
|
+
* Handle usage of on_duplicate_key_update in MySQL prepared statements (jeremyevans) (#404)
|
|
44
|
+
|
|
45
|
+
* Make after_commit and after_rollback respect :server option (jeremyevans) (#401)
|
|
46
|
+
|
|
47
|
+
* Respect :connect_timeout option in the postgres adapter when using pg (glebpom, jeremyevans) (#402)
|
|
48
|
+
|
|
49
|
+
* Make Dataset#destroy for model datasets respect dataset shard when using a transaction (jeremyevans)
|
|
50
|
+
|
|
51
|
+
* Make :server option to Model#save set the shard to use (jeremyevans)
|
|
52
|
+
|
|
53
|
+
* Move Model#set_server from the sharding plugin to the base plugin (jeremyevans)
|
|
54
|
+
|
|
55
|
+
* Add :graph_alias_base association option for setting base name to use for table aliases when eager graphing (jeremyevans)
|
|
56
|
+
|
|
57
|
+
* Make ILIKE work correctly on Microsoft SQL Server if database/column collation is case sensitive (jfirebaugh) (#398)
|
|
58
|
+
|
|
59
|
+
* When starting a new dataset graph, assume existing selection is the columns to select from the current table (jeremyevans)
|
|
60
|
+
|
|
61
|
+
* Allow specifying nanoseconds and offsets when converting a hash or array to a timestamp (jeremyevans, jfirebaugh) (#395)
|
|
62
|
+
|
|
63
|
+
* Improve performance when converting Java types to ruby types in the jdbc adapter (jeremyevans, jfirebaugh) (#395)
|
|
64
|
+
|
|
65
|
+
* Fix tinytds adapter if DB.identifier_output_method = nil (jeremyevans)
|
|
66
|
+
|
|
67
|
+
* Explicitly order by the row number column when emulating offsets (jfirebaugh) (#393)
|
|
68
|
+
|
|
69
|
+
* Fix Dataset#graph and #eager_graph modifying the receiver if the receiver is already graphed (jeremyevans) (#392)
|
|
70
|
+
|
|
71
|
+
* Change dataset literalization to an append-only-all-the-way-down design (jeremyevans)
|
|
72
|
+
|
|
73
|
+
=== 3.29.0 (2011-11-01)
|
|
74
|
+
|
|
75
|
+
* Allow Model.dataset_module to take a Module instance (jeremyevans)
|
|
76
|
+
|
|
77
|
+
* Apply Model.[] optimization in more cases (jeremyevans)
|
|
78
|
+
|
|
79
|
+
* Fix Model.[] optimization when dataset uses identifier_input_method different than database (jeremyevans)
|
|
80
|
+
|
|
81
|
+
* Work around pragma bug on jdbc/sqlite when emulating alter table support (jeremyevans)
|
|
82
|
+
|
|
83
|
+
* Database#<< and Dataset#<< now return self so they can be safely chained (jeremyevans)
|
|
84
|
+
|
|
85
|
+
* Fully support using an aliased table name as the :join_table option for a many_to_many association (jeremyevans)
|
|
86
|
+
|
|
87
|
+
* Make like case sensitive on SQLite and Microsoft SQL Server (use ilike for case insensitive matching) (jeremyevans)
|
|
88
|
+
|
|
89
|
+
* Add Database#extend_datasets for the equivalent of extending of the Database object's datasets with a module (jeremyevans)
|
|
90
|
+
|
|
91
|
+
* Speed up Dataset #map, #to_hash, and related methods if an array of symbols is given (jeremyevans)
|
|
92
|
+
|
|
93
|
+
* Add Database#dataset_class for modifying the class used for datasets for a single Database object (jeremyevans)
|
|
94
|
+
|
|
95
|
+
* Plugins that override Model.load should be modified to override Model.call instead (jeremyevans)
|
|
96
|
+
|
|
97
|
+
* Speed up loading model objects from the database by up to 7-16% (jeremyevans)
|
|
98
|
+
|
|
99
|
+
* Create accessor methods for all columns in a model's table, even if the dataset doesn't select the columns (jeremyevans)
|
|
100
|
+
|
|
101
|
+
* Add mock adapter for better mocking of a database connection (jeremyevans)
|
|
102
|
+
|
|
103
|
+
* Have models pass their dataset instead of table name to Database#schema (jeremyevans)
|
|
104
|
+
|
|
105
|
+
* Allow Database#schema to take a dataset as the table argument, and use its identifier input/output methods (jeremyevans)
|
|
106
|
+
|
|
107
|
+
* Significant improvements to the db2 adapter (jeremyevans)
|
|
108
|
+
|
|
109
|
+
* Handle methods with names that can't be called directly in Model.def_dataset_method (jeremyevans)
|
|
110
|
+
|
|
111
|
+
* Add dataset_associations plugin for making dataset methods that return datasets of associated objects (jeremyevans)
|
|
112
|
+
|
|
113
|
+
* Don't allow Model.def_dataset_method to override private model methods (jeremyevans)
|
|
114
|
+
|
|
115
|
+
* Parsing primary key information from system tables in the shared MSSQL adapter (jeremyevans)
|
|
116
|
+
|
|
117
|
+
* Fix handling of composite primary keys when emulating alter table operations on SQLite (jeremyevans)
|
|
118
|
+
|
|
119
|
+
* Emulate add_constraint and drop_constraint alter table operations on SQLite (jeremyevans)
|
|
120
|
+
|
|
121
|
+
* Apply the correct pragmas when connecting to SQLite via the Amalgalite and Swift adapters (jeremyevans)
|
|
122
|
+
|
|
123
|
+
* Fix bound variable usage for some types (e.g. Date) when used outside of prepared statements on SQLite (jeremyevans)
|
|
124
|
+
|
|
125
|
+
* Work around SQLite column naming bug when using subselects (jeremyevans)
|
|
126
|
+
|
|
127
|
+
* Make prepared_statements plugin work with adapters that require type specifiers for variable placeholders, such as oracle (jeremyevans)
|
|
128
|
+
|
|
129
|
+
* Add savepoint support to the generic JDBC transaction support (used by 6 jdbc subadapters) (jeremyevans)
|
|
130
|
+
|
|
131
|
+
* Add native prepared statement support to the oracle adapter (jeremyevans)
|
|
132
|
+
|
|
133
|
+
* Support sharding correctly by default when using transactions in model saving/destroying (jeremyevans)
|
|
134
|
+
|
|
135
|
+
* Add Database#in_transaction? method for checking if you are already in a transaction (jeremyevans)
|
|
136
|
+
|
|
137
|
+
* Add after_commit, after_rollback, after_destroy_commit, and after_destroy_rollback hooks to Model objects (jeremyevans)
|
|
138
|
+
|
|
139
|
+
* Add after_commit and after_rollback hooks to Database objects (jeremyevans) (#383)
|
|
140
|
+
|
|
141
|
+
* Support savepoints inside prepared transactions on MySQL (jeremyevans)
|
|
142
|
+
|
|
143
|
+
* Support opening transactions to multiple shards of the same Database object in the same Thread (jeremyevans)
|
|
144
|
+
|
|
145
|
+
* Add Sequel.transaction for running transactions on multiple databases at the same time (jeremyevans)
|
|
146
|
+
|
|
147
|
+
* Support :rollback => :always option in Database#transaction to always rollback the transaction (jeremyevans)
|
|
148
|
+
|
|
149
|
+
* Support :rollback => :reraise option in Database#transaction to reraise the Sequel::Rollback exception (jeremyevans)
|
|
150
|
+
|
|
151
|
+
* Add support for connecting to Apache Derby databases using the jdbc adapter (jeremyevans)
|
|
152
|
+
|
|
153
|
+
* Add support for connecting to HSQLDB databases using the jdbc adapter (jeremyevans)
|
|
154
|
+
|
|
155
|
+
* Fix inserting all default values into a table on DB2 (jeremyevans)
|
|
156
|
+
|
|
157
|
+
* Add :qualify option to many_to_one associations for whether to qualify the primary key column with the associated table (jeremyevans)
|
|
158
|
+
|
|
159
|
+
* Modify rcte_tree plugin to use column aliases if recursive CTEs require them (jeremyevans)
|
|
160
|
+
|
|
161
|
+
* Add Dataset#recursive_cte_requires_column_aliases? method to check if you must provide an argument list for a recursive CTE (jeremyevans)
|
|
162
|
+
|
|
163
|
+
* Much better support for Oracle in both the oci8-based oracle adapter and the jdbc oracle subadapter (jeremyevans)
|
|
164
|
+
|
|
165
|
+
* Handle CTEs in subselects in more places on databases that don't natively support CTEs in subselects (jeremyevans)
|
|
166
|
+
|
|
167
|
+
* Change Dataset#to_hash to not call the row_proc if 2 arguments are given (jeremyevans)
|
|
168
|
+
|
|
169
|
+
* Change Dataset#map to not call the row_proc if an argument is given (jeremyevans)
|
|
170
|
+
|
|
171
|
+
* Make Dataset#select_map and #select_order_map return an array of single element arrays if given an array with a single symbol (jeremyevans)
|
|
172
|
+
|
|
173
|
+
* Make Dataset#columns work correctly on jdbc, odbc, ado, and dbi adapters when using an emulated offset on MSSQL and DB2 (jeremyevans)
|
|
174
|
+
|
|
175
|
+
* Add Database#listen and #notify to the postgres adapter, for LISTEN and NOTIFY support (jeremyevans)
|
|
176
|
+
|
|
177
|
+
* Emulate the bitwise compliment operator on h2 (jeremyevans)
|
|
178
|
+
|
|
179
|
+
* Fix improper handling of emulated bitwise operators with more than two arguments (jeremyevans)
|
|
180
|
+
|
|
181
|
+
* Allow convert_invalid_date_time to be set on a per-Database basis in the mysql adapter (jeremyevans)
|
|
182
|
+
|
|
183
|
+
* Allow convert_tinyint_to_bool to be set on a per-Database basis in the mysql and mysql2 adapters (jeremyevans)
|
|
184
|
+
|
|
185
|
+
* Allow per-Database override of the typeconversion procs on the mysql, sqlite, and ibmdb adapters (jeremyevans)
|
|
186
|
+
|
|
187
|
+
* Add Database#timezone accessor, for overriding Sequel.database_timezone per Database object (jeremyevans)
|
|
188
|
+
|
|
189
|
+
=== 3.28.0 (2011-10-03)
|
|
190
|
+
|
|
191
|
+
* Add firebird jdbc subadapter (jeremyevans)
|
|
192
|
+
|
|
193
|
+
* Add SQLTime.create method for easier creation of SQLTime instances (jeremyevans)
|
|
194
|
+
|
|
195
|
+
* Make Dataset#with_pk use a qualified primary key, so it works correctly on joined datasets (jeremyevans)
|
|
196
|
+
|
|
197
|
+
* Support the :limit association option when using eager_graph (jeremyevans)
|
|
198
|
+
|
|
199
|
+
* Fix eager loading via eager_graph of one_to_one associations that match multiple associated objects and use order to pick the first one (jeremyevans)
|
|
200
|
+
|
|
201
|
+
* Make after_load association hooks apply when using eager_graph (jeremyevans)
|
|
202
|
+
|
|
203
|
+
* Make Dataset#with_sql treat a symbol as a first argument as a method name to call to get the SQL (jeremyevans)
|
|
204
|
+
|
|
205
|
+
* Make Dataset #delete, #insert, #update return array of plain hashes if block not given and Dataset#returning is used (jeremyevans)
|
|
206
|
+
|
|
207
|
+
* Allow Dataset #map, #to_hash, #select_map, #select_order_map, and #select_hash to take arrays of columns instead of single columns (jeremyevans)
|
|
208
|
+
|
|
209
|
+
* Make Dataset #delete, #insert, #update yield plain hashes to a block if Dataset#returning is used (jeremyevans)
|
|
210
|
+
|
|
211
|
+
* Add Dataset#returning for setting the columns to return in INSERT/UPDATE/DELETE statements, used by PostgreSQL 9.1 (jeremyevans)
|
|
212
|
+
|
|
213
|
+
* Support WITH clause in INSERT/UPDATE/DELETE on PostgreSQL 9.1+ (jeremyevans)
|
|
214
|
+
|
|
215
|
+
* Add Database#copy_table for PostgreSQL COPY support when using the postgres adapter with pg (jeremyevans)
|
|
216
|
+
|
|
217
|
+
* Support CREATE TABLE IF NOT EXISTS on PostgreSQL 9.1+ (jeremyevans)
|
|
218
|
+
|
|
219
|
+
* Add support for Sequel::Model.default_eager_limit_strategy to set the default :eager_limit_strategy for *_many associations (jeremyevans)
|
|
220
|
+
|
|
221
|
+
* Add support for an :eager_limit_strategy => :correlated_subquery value for limiting using correlated subqueries (jeremyevans)
|
|
222
|
+
|
|
223
|
+
* Allow use of a dataset that uses the emulated offset support on MSSQL and DB2 in an IN subquery by using a nested subquery (jeremyevans)
|
|
224
|
+
|
|
225
|
+
* Allow use of a dataset that uses LIMIT in an IN subquery on MySQL by using a nested subquery (jeremyevans)
|
|
226
|
+
|
|
227
|
+
* Work around serious ActiveSupport bug in Time.=== that breaks literalization of Time values (jeremyevans)
|
|
228
|
+
|
|
229
|
+
* Speed up SQL operator methods by using module_eval instead of define_method (jeremyevans)
|
|
230
|
+
|
|
231
|
+
* Support sql_(boolean,number,string) methods on ComplexExpressions, allowing you do to (x + 1).sql_string + 'a' for (x + 1) || 'a' (jeremyevans)
|
|
232
|
+
|
|
233
|
+
* Don't disallow SQL expression creation based on types, leave that to the database server (jeremyevans)
|
|
234
|
+
|
|
235
|
+
* Make :column [&|] 1 use an SQL bitwise [&|] expression instead of a logical (AND|OR) expression (jeremyevans)
|
|
236
|
+
|
|
237
|
+
* Make :column + 'a' use an SQL string concatenation expression instead of an addition expression (jeremyevans)
|
|
238
|
+
|
|
239
|
+
* Fix :time typecasting from Time to SQLTime for fractional seconds on ruby 1.9 (jeremyevans)
|
|
240
|
+
|
|
241
|
+
* Have Dataset#select_append check supports_select_all_and_column? and select all from all FROM and JOIN tables if no columns selected (jeremyevans)
|
|
242
|
+
|
|
243
|
+
* Add Dataset#supports_select_all_and_column? for checking if you can do SELECT *, column (jeremyevans)
|
|
244
|
+
|
|
245
|
+
* Add support for an :eager_limit_strategy => :window_function value for limiting using window functions (jeremyevans)
|
|
246
|
+
|
|
247
|
+
* Add support for an :eager_limit_strategy => :distinct_on value for one_to_one associations for using DISTINCT ON (jeremyevans)
|
|
248
|
+
|
|
249
|
+
* Add support for an :eager_limit_strategy association option, for manual control over how limiting is done (jeremyevans)
|
|
250
|
+
|
|
251
|
+
* Add Dataset#supports_ordered_distinct_on? for checking if the dataset can use distinct on while respecting order (jeremyevans)
|
|
252
|
+
|
|
253
|
+
* Add support for the association :limit option when eager loading via .eager for *_many associations (jeremyevans)
|
|
254
|
+
|
|
255
|
+
* Add db2 jdbc subadapter (jeremyevans)
|
|
256
|
+
|
|
257
|
+
* Fix the db2 adapter so it actually works (jeremyevans)
|
|
258
|
+
|
|
259
|
+
* Add ibmdb adapter for accessing DB2 (roylez, jeremyevans) (#376)
|
|
260
|
+
|
|
261
|
+
* Add much better support for DB2 databases (roylez, jeremyevans) (#376)
|
|
262
|
+
|
|
263
|
+
* Handle SQL::AliasedExpressions and SQL::JoinClauses in Dataset#select_all (jeremyevans)
|
|
264
|
+
|
|
265
|
+
* Speed up type translation slightly in mysql, postgres, and sqlite adapters (jeremyevans)
|
|
266
|
+
|
|
267
|
+
* Add Dataset#supports_cte_in_subqueries? for checking whether database supports WITH in subqueries (jeremyevans)
|
|
268
|
+
|
|
269
|
+
* Allow Model.set_dataset to accept Sequel::LiteralString arguments as table names (jeremyevans)
|
|
270
|
+
|
|
271
|
+
* Association :after_load hooks in lazy loading are now called after the associated objects have been cached (jeremyevans)
|
|
272
|
+
|
|
273
|
+
* Emulate handling of extract on MSSQL, using datepart (jeremyevans)
|
|
274
|
+
|
|
275
|
+
* Emulate handling of extract on SQLite, but you need to set Database#use_timestamp_timezones = false (jeremyevans)
|
|
276
|
+
|
|
277
|
+
* Abstract handling of ComplexExpressionMethods#extract so that it can work on databases that don't implement extract (jeremyevans)
|
|
278
|
+
|
|
279
|
+
* Emulate xor operator on SQLite (jeremyevans)
|
|
280
|
+
|
|
281
|
+
* Add Dataset#supports_where_true? for checking if the database supports WHERE true (or WHERE 1 if 1 is true) (jeremyevans)
|
|
282
|
+
|
|
283
|
+
* Fix eager loading via eager of one_to_one associations that match multiple associated objects and use order to pick the first one (jeremyevans)
|
|
284
|
+
|
|
285
|
+
=== 3.27.0 (2011-09-01)
|
|
286
|
+
|
|
287
|
+
* Add support for native prepared statements to the tinytds adapter (jeremyevans)
|
|
288
|
+
|
|
289
|
+
* Add support for native prepared statements and stored procedures to the mysql2 adapter (jeremyevans)
|
|
290
|
+
|
|
291
|
+
* Support dropping primary key, foreign key, and unique constraints on MySQL via the drop_constraint :type option (jeremyevans)
|
|
292
|
+
|
|
293
|
+
* Add Sequel::SQLTime class for handling SQL time columns (jeremyevans)
|
|
294
|
+
|
|
295
|
+
* Typecast DateTime objects to Date for date columns (jeremyevans)
|
|
296
|
+
|
|
297
|
+
* When typecasting Date objects to timestamps, make the resulting objects always have no fractional date components (jeremyevans)
|
|
298
|
+
|
|
299
|
+
* Add Model.dataset_module for simplifying many def_dataset_method calls (jeremyevans)
|
|
300
|
+
|
|
301
|
+
* Make prepared_statements_safe plugin work on classes without datasets (jeremyevans)
|
|
302
|
+
|
|
303
|
+
* Make Dataset#hash work correctly when referencing SQL::Expression instances (jeremyevans)
|
|
304
|
+
|
|
305
|
+
* Handle allowed mass assignment methods correctly when including modules in classes or extending instances with modules (jeremyevans)
|
|
306
|
+
|
|
307
|
+
* Fix Model#hash to work correctly with composite primary keys and with no primary key (jeremyevans)
|
|
308
|
+
|
|
309
|
+
* Model#exists? now returns false without issuing a query for new model objects (jeremyevans)
|
|
310
|
+
|
|
311
|
+
=== 3.26.0 (2011-08-01)
|
|
312
|
+
|
|
313
|
+
* Fix bug in default connection pool if a disconnect error is raised and the disconnection_proc also raises an error (jeremyevans)
|
|
314
|
+
|
|
315
|
+
* Disallow eager loading via eager of many_*_many associations with :eager_graph option (jeremyevans)
|
|
316
|
+
|
|
317
|
+
* Major speedup in dataset creation (jeremyevans)
|
|
318
|
+
|
|
319
|
+
* Replace internal implementation of eager_graph with much faster version (jeremyevans)
|
|
320
|
+
|
|
321
|
+
* Don't treat strings with leading zeros as octal format in the default typecasting (jeremyevans)
|
|
322
|
+
|
|
323
|
+
* Fix literalization of Date, Time, and DateTime values on Microsoft Access (jeremyevans)
|
|
324
|
+
|
|
325
|
+
* Fix handling of nil values with the pure-Java version of nokogiri in the xml_serializer plugin (jeremyevans)
|
|
326
|
+
|
|
327
|
+
* Make identity_map plugin work with standard eager loading of many_to_many and many_through_many associations (jeremyevans)
|
|
328
|
+
|
|
329
|
+
* Make create_table! only attempt to drop the table if it already exists (jeremyevans)
|
|
330
|
+
|
|
331
|
+
* Remove custom table_exists? implementations in the oracle and postgres adapters (jeremyevans)
|
|
332
|
+
|
|
333
|
+
* Handle another type of disconnection in the postgres adapter (jeremyevans)
|
|
334
|
+
|
|
335
|
+
* Handle disconnections in the ado adapter and do postgres subadapter (jeremyevans)
|
|
336
|
+
|
|
337
|
+
* Recognize disconnections when issuing BEGIN/ROLLBACK/COMMIT statements (jeremyevans) (#368)
|
|
338
|
+
|
|
339
|
+
=== 3.25.0 (2011-07-01)
|
|
340
|
+
|
|
341
|
+
* Work with tiny_tds-0.4.5 in the tinytds adapter, older versions are no longer supported (jeremyevans)
|
|
342
|
+
|
|
343
|
+
* Make association_pks plugin typecast provided values to integer if the primary key column type is integer (jeremyevans)
|
|
344
|
+
|
|
345
|
+
* Model.set_dataset now accepts Identifier, QualifiedIdentifier, and AliasedExpression arguments (jeremyevans)
|
|
346
|
+
|
|
347
|
+
* Fix handling of nil values in bound variables and prepared statement and stored procedure arguments in the jdbc adapter (jeremyevans, wei)
|
|
348
|
+
|
|
349
|
+
* Allow treating Datasets as Expressions, e.g. DB[:table1].select(:column1) > DB[:table2].select(:column2) (jeremyevans)
|
|
350
|
+
|
|
351
|
+
* No longer use CASCADE by default when dropping tables on PostgreSQL (jeremyevans)
|
|
352
|
+
|
|
353
|
+
* Support :cascade option to #drop_table, #drop_view, #drop_column, and #drop_constraint for using CASCADE (jeremyevans)
|
|
354
|
+
|
|
355
|
+
* If validation error messages are LiteralStrings, don't add the column name to them in Errors#full_messages (jeremyevans)
|
|
356
|
+
|
|
357
|
+
* Fix bug loading plugins on 1.9 where ::ClassMethods, ::InstanceMethods, or ::DatasetMethods is defined (jeremyevans)
|
|
358
|
+
|
|
359
|
+
* Add Dataset#exclude_where and Dataset#exclude_having methods, so you can force use of having or where clause (jeremyevans)
|
|
360
|
+
|
|
361
|
+
* Allow Dataset#select_all to take table name arguments and select all columns from each given table (jeremyevans)
|
|
362
|
+
|
|
363
|
+
* Add Dataset#select_group method, for selecting and grouping on the same columns (jeremyevans)
|
|
364
|
+
|
|
365
|
+
* Allow Dataset#group and Dataset#group_and_count to accept a virtual row block (jeremyevans)
|
|
366
|
+
|
|
367
|
+
=== 3.24.1 (2011-06-03)
|
|
368
|
+
|
|
369
|
+
* Ignore index creation errors if using create_table? with the IF NOT EXISTS syntax (jeremyevans) (#362)
|
|
370
|
+
|
|
371
|
+
=== 3.24.0 (2011-06-01)
|
|
372
|
+
|
|
373
|
+
* Add prepared_statements_association plugin, for using prepared statements by default for regular association loading (jeremyevans)
|
|
374
|
+
|
|
375
|
+
* Add prepared_statements_safe plugin, for making prepared statement use with models more safe (jeremyevans)
|
|
376
|
+
|
|
377
|
+
* Add prepared_statements_with_pk plugin, for using prepared statements for dataset lookups by primary key (jeremyevans)
|
|
378
|
+
|
|
379
|
+
* Fix bug in emulated prepared statement support not supporting nil or false as bound values (jeremyevans)
|
|
380
|
+
|
|
381
|
+
* Add Dataset#unbind for unbinding values from a dataset, for use with creating prepared statements (jeremyevans)
|
|
382
|
+
|
|
383
|
+
* Add prepared_statements plugin for using prepared statements for updates, inserts, deletes, and lookups by primary key (jeremyevans)
|
|
384
|
+
|
|
385
|
+
* Make Dataset#[] for model datasets consider a single integer argument as a lookup by primary key (jeremyevans)
|
|
386
|
+
|
|
387
|
+
* Add Dataset#with_pk for model datasets, for finding first record with matching primary key value (jeremyevans)
|
|
388
|
+
|
|
389
|
+
* Add defaults_setter plugin for setting default values when initializing model instances (jeremyevans)
|
|
390
|
+
|
|
391
|
+
* Add around hooks (e.g. around_save) to Sequel::Model (jeremyevans)
|
|
392
|
+
|
|
393
|
+
* Add Model#initialize_set private method to ease extension writing (jeremyevans)
|
|
394
|
+
|
|
395
|
+
* Only typecast bit fields to booleans on MSSQL, the MySQL bit type is a bitfield, not a boolean (jeremyevans)
|
|
396
|
+
|
|
397
|
+
* Set SQL_AUTO_IS_NULL=0 by default when connecting to MySQL via the swift and jdbc adapters (jeremyevans)
|
|
398
|
+
|
|
399
|
+
* Fix bug in multiple column IN/NOT IN emulation when a model dataset is used (jeremyevans)
|
|
400
|
+
|
|
401
|
+
* Add support for filtering and excluding by association datasets (jeremyevans)
|
|
402
|
+
|
|
403
|
+
* Fix literalization of boolean values in filters on SQLite and MSSQL (jeremyevans)
|
|
404
|
+
|
|
405
|
+
* Add support for filtering and excluding by multiple associations (jeremyevans)
|
|
406
|
+
|
|
407
|
+
* Add support for inverting some SQL::Constant instances such as TRUE, FALSE, NULL, and NOTNULL (jeremyevans)
|
|
408
|
+
|
|
409
|
+
* Add support for excluding by associations to model datasets (jeremyevans)
|
|
410
|
+
|
|
411
|
+
* The Sequel::Postgres.use_iso_date_format setting now only affects future Database objects (jeremyevans)
|
|
412
|
+
|
|
413
|
+
* Add Sequel::Postgres::PG_NAMED_TYPES hash for extensions to register type conversions for non-standard types (jeremyevans, pvh)
|
|
414
|
+
|
|
415
|
+
* Make create_table? use IF NOT EXISTS instead of using SELECT to determine existence, if supported (jeremyevans)
|
|
416
|
+
|
|
417
|
+
* Fix bug in association_pks plugin when associated table has a different primary key column name (jfirebaugh)
|
|
418
|
+
|
|
419
|
+
* Fix limiting rows when connecting to DB2 (semmons99)
|
|
420
|
+
|
|
421
|
+
* Exclude columns from tables in the INFORMATION_SCHEMA when parsing table schema on JDBC (jeremyevans)
|
|
422
|
+
|
|
423
|
+
* Fix limiting rows when connecting to Microsoft Access (jeremyevans)
|
|
424
|
+
|
|
425
|
+
* Add Database#views for getting an array of symbols of view names for the database (jeremyevans, christian.michon)
|
|
426
|
+
|
|
427
|
+
* Make Datbase#tables no longer include view names on MySQL (jeremyevans)
|
|
428
|
+
|
|
429
|
+
* Convert Java CLOB objects to ruby strings when using the JDBC JTDS subadapter (christian.michon)
|
|
430
|
+
|
|
431
|
+
* If Thread#kill is called on a thread with an open transaction, roll the transaction back on ruby 1.8 and rubinius (jeremyevans)
|
|
432
|
+
|
|
433
|
+
* Split informix adapter into shared/specific parts, add JDBC informix subadapter (jeremyevans)
|
|
434
|
+
|
|
435
|
+
=== 3.23.0 (2011-05-02)
|
|
436
|
+
|
|
437
|
+
* Migrate issue tracker from Google Code to GitHub Issues (jeremyevans)
|
|
438
|
+
|
|
439
|
+
* Add support for filtering by associations to model datasets (jeremyevans)
|
|
440
|
+
|
|
441
|
+
* Don't call insert_select when saving a model that doesn't select all columns of the table (jeremyevans)
|
|
442
|
+
|
|
443
|
+
* Fix bug when using :select=>[] option for a many_to_many association (jeremyevans)
|
|
444
|
+
|
|
445
|
+
* Add a columns_introspection extension that attempts to skip database queries by introspecting selected columns (jeremyevans)
|
|
446
|
+
|
|
447
|
+
* When combining old integer migrations and new timestamp migrations, make sure old integer migrations are all applied first (jeremyevans)
|
|
448
|
+
|
|
449
|
+
* Support dynamic callbacks to customize regular association loading at query time (jeremyevans)
|
|
450
|
+
|
|
451
|
+
* Support cascading of eager loading with dynamic callbacks for both eager and eager_graph (jeremyevans)
|
|
452
|
+
|
|
453
|
+
* Make the xml_serializer plugin handle namespaced models by using __ instead of / as a separator (jeremyevans)
|
|
454
|
+
|
|
455
|
+
* Allow the :eager_grapher association proc to accept a single hash instead of 3 arguments (jfirebaugh)
|
|
456
|
+
|
|
457
|
+
* Support dynamic callbacks to customize eager loading at query time (jfirebaugh, jeremyevans)
|
|
458
|
+
|
|
459
|
+
* Fix bug in the identity_map plugin for many_to_one associations when the association reflection hadn't been filled in yet (funny-falcon)
|
|
460
|
+
|
|
461
|
+
* Add serialization_modification_detection plugin for detecting changes in serialized columns (jeremyevans) (#333)
|
|
462
|
+
|
|
463
|
+
=== 3.22.0 (2011-04-01)
|
|
464
|
+
|
|
465
|
+
* Add disconnect detection to tinytds adapter, though correct behavior may require an update to tiny_tds (cult_hero)
|
|
466
|
+
|
|
467
|
+
* Add Dataset/Database#mssql_unicode_strings accessor when connecting to MSSQL to control string literalization (semmons99, jeremyevans)
|
|
468
|
+
|
|
469
|
+
* Fix ODBC::Time instance handling in the odbc adapter (jeremyevans)
|
|
470
|
+
|
|
471
|
+
* Use Sequel.application_timezone when connecting in the oracle adapter to set the connection's session's timezone (jmthomas)
|
|
472
|
+
|
|
473
|
+
* In the ADO adapter, assume access to SQL Server if a :conn_string option is given that doesn't indicate Access/Jet (damir.si) (#332)
|
|
474
|
+
|
|
475
|
+
* Use the correct class when loading instances for descendents of model classes that use single table inheritance (jeremyevans)
|
|
476
|
+
|
|
477
|
+
* Support for COLLATE in column definitions (jfirebaugh)
|
|
478
|
+
|
|
479
|
+
* Don't use a schema when creating a temporary table (jeremyevans)
|
|
480
|
+
|
|
481
|
+
* Make migrator work correctly when a default_schema is set (jeremyevans) (#331)
|
|
482
|
+
|
|
1
483
|
=== 3.21.0 (2011-03-01)
|
|
2
484
|
|
|
3
485
|
* Make symbol splitting (:table__column___alias) work correctly for identifiers that are not in the \w character class (authorNari)
|
|
@@ -2954,9 +3436,9 @@
|
|
|
2954
3436
|
|
|
2955
3437
|
=== 0.1.9.3 (2007-08-10)
|
|
2956
3438
|
|
|
2957
|
-
* Added support for specifying field size in schema definitions (thanks Florian
|
|
3439
|
+
* Added support for specifying field size in schema definitions (thanks Florian Assmann.)
|
|
2958
3440
|
|
|
2959
|
-
* Added migration code based on work by Florian
|
|
3441
|
+
* Added migration code based on work by Florian Assmann.
|
|
2960
3442
|
|
|
2961
3443
|
* Reintroduced metaid dependency. No need to keep a local copy of it.
|
|
2962
3444
|
|
|
@@ -3034,7 +3516,7 @@
|
|
|
3034
3516
|
|
|
3035
3517
|
* Fixed Dataset#first to include a LIMIT clause for a single record.
|
|
3036
3518
|
|
|
3037
|
-
* Small fix to Postgres driver to return a primary_key value for the inserted record if it is specified in the insertion values (thanks Florian
|
|
3519
|
+
* Small fix to Postgres driver to return a primary_key value for the inserted record if it is specified in the insertion values (thanks Florian Assmann and Pedro Gutierrez).
|
|
3038
3520
|
|
|
3039
3521
|
* Fixed Symbol#DESC to support qualified notation (thanks Pedro Gutierrez).
|
|
3040
3522
|
|
data/README.rdoc
CHANGED
|
@@ -12,15 +12,15 @@ toolkit for Ruby.
|
|
|
12
12
|
two-phase commit, transaction isolation, master/slave
|
|
13
13
|
configurations, and database sharding.
|
|
14
14
|
* Sequel currently has adapters for ADO, Amalgalite, DataObjects,
|
|
15
|
-
DB2, DBI, Firebird, Informix, JDBC, MySQL, Mysql2, ODBC,
|
|
16
|
-
Oracle, PostgreSQL, SQLite3, Swift, and TinyTDS.
|
|
15
|
+
DB2, DBI, Firebird, IBM_DB, Informix, JDBC, MySQL, Mysql2, ODBC,
|
|
16
|
+
OpenBase, Oracle, PostgreSQL, SQLite3, Swift, and TinyTDS.
|
|
17
17
|
|
|
18
18
|
== Resources
|
|
19
19
|
|
|
20
20
|
* {Website}[http://sequel.rubyforge.org]
|
|
21
21
|
* {Blog}[http://sequel.heroku.com]
|
|
22
22
|
* {Source code}[http://github.com/jeremyevans/sequel]
|
|
23
|
-
* {Bug tracking}[http://
|
|
23
|
+
* {Bug tracking}[http://github.com/jeremyevans/sequel/issues]
|
|
24
24
|
* {Google group}[http://groups.google.com/group/sequel-talk]
|
|
25
25
|
* {RDoc}[http://sequel.rubyforge.org/rdoc]
|
|
26
26
|
|
|
@@ -573,7 +573,7 @@ You can execute custom code when creating, updating, or deleting records by defi
|
|
|
573
573
|
|
|
574
574
|
Note the use of +super+ if you define your own hook methods. Almost all <tt>Sequel::Model</tt> class and instance methods (not just hook methods) can be overridden safely, but you have to make sure to call +super+ when doing so, otherwise you risk breaking things.
|
|
575
575
|
|
|
576
|
-
For the example above, you should probably use a database trigger if you can. Hooks can be used for data integrity, but they will only enforce that integrity when you are modifying the database through model instances. If you plan on allowing any other access to the database, it's best to use database triggers for data integrity.
|
|
576
|
+
For the example above, you should probably use a database trigger if you can. Hooks can be used for data integrity, but they will only enforce that integrity when you are modifying the database through model instances. If you plan on allowing any other access to the database, it's best to use database triggers and constraints for data integrity.
|
|
577
577
|
|
|
578
578
|
=== Deleting records
|
|
579
579
|
|
|
@@ -681,9 +681,23 @@ Associations can be eagerly loaded via +eager+ and the <tt>:eager</tt> associati
|
|
|
681
681
|
# Loads all people, their posts, their posts' tags, replies to those posts,
|
|
682
682
|
# the person for each reply, the tag for each reply, and all posts and
|
|
683
683
|
# replies that have that tag. Uses a total of 8 queries.
|
|
684
|
-
Person.eager(:posts=>{:replies=>[:person, {:tags=>
|
|
684
|
+
Person.eager(:posts=>{:replies=>[:person, {:tags=>[:posts, :replies]}]}).all
|
|
685
685
|
|
|
686
|
-
In addition to using +eager+, you can also use +eager_graph+, which will use a single query to get the object and all associated objects. This may be necessary if you want to filter or order the result set based on columns in associated tables. It works with cascading as well, the
|
|
686
|
+
In addition to using +eager+, you can also use +eager_graph+, which will use a single query to get the object and all associated objects. This may be necessary if you want to filter or order the result set based on columns in associated tables. It works with cascading as well, the API is very similar. Note that using +eager_graph+ to eagerly load multiple <tt>*_to_many</tt> associations will cause the result set to be a cartesian product, so you should be very careful with your filters when using it in that case.
|
|
687
|
+
|
|
688
|
+
You can dynamically customize the eagerly loaded dataset by using using a proc. This proc is passed the dataset used for eager loading, and should return a modified copy of that dataset:
|
|
689
|
+
|
|
690
|
+
# Eagerly load only replies containing 'foo'
|
|
691
|
+
Post.eager(:replies=>proc{|ds| ds.filter(text.like('%foo%'))}).all
|
|
692
|
+
|
|
693
|
+
This also works when using +eager_graph+, in which case the proc is called with dataset to graph into the current dataset:
|
|
694
|
+
|
|
695
|
+
Post.eager_graph(:replies=>proc{|ds| ds.filter(text.like('%foo%'))}).all
|
|
696
|
+
|
|
697
|
+
You can dynamically customize eager loads for both +eager+ and +eager_graph+ while also cascading, by making the value a single entry hash with the proc as a key, and the cascaded associations as the value:
|
|
698
|
+
|
|
699
|
+
# Eagerly load only replies containing 'foo', and the person and tags for those replies
|
|
700
|
+
Post.eager(:replies=>{proc{|ds| ds.filter(text.like('%foo%'))}=>[:person, :tags]}).all
|
|
687
701
|
|
|
688
702
|
=== Extending the underlying dataset
|
|
689
703
|
|