rom-sql 3.0.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +428 -297
  3. data/LICENSE +20 -0
  4. data/README.md +14 -56
  5. data/lib/rom-sql.rb +2 -0
  6. data/lib/rom/plugins/relation/sql/auto_restrictions.rb +2 -0
  7. data/lib/rom/plugins/relation/sql/instrumentation.rb +2 -0
  8. data/lib/rom/plugins/relation/sql/postgres/explain.rb +6 -7
  9. data/lib/rom/plugins/relation/sql/postgres/full_text_search.rb +53 -0
  10. data/lib/rom/plugins/relation/sql/postgres/streaming.rb +97 -0
  11. data/lib/rom/sql.rb +2 -0
  12. data/lib/rom/sql/associations.rb +2 -0
  13. data/lib/rom/sql/associations/core.rb +10 -0
  14. data/lib/rom/sql/associations/many_to_many.rb +3 -1
  15. data/lib/rom/sql/associations/many_to_one.rb +2 -0
  16. data/lib/rom/sql/associations/one_to_many.rb +2 -0
  17. data/lib/rom/sql/associations/one_to_one.rb +2 -0
  18. data/lib/rom/sql/associations/one_to_one_through.rb +2 -0
  19. data/lib/rom/sql/associations/self_ref.rb +2 -0
  20. data/lib/rom/sql/attribute.rb +31 -22
  21. data/lib/rom/sql/attribute_aliasing.rb +88 -0
  22. data/lib/rom/sql/attribute_wrapping.rb +30 -0
  23. data/lib/rom/sql/commands.rb +2 -0
  24. data/lib/rom/sql/commands/create.rb +2 -0
  25. data/lib/rom/sql/commands/delete.rb +2 -0
  26. data/lib/rom/sql/commands/error_wrapper.rb +2 -0
  27. data/lib/rom/sql/commands/update.rb +2 -0
  28. data/lib/rom/sql/dsl.rb +11 -3
  29. data/lib/rom/sql/error.rb +2 -0
  30. data/lib/rom/sql/errors.rb +2 -0
  31. data/lib/rom/sql/extensions.rb +2 -0
  32. data/lib/rom/sql/extensions/active_support_notifications.rb +2 -0
  33. data/lib/rom/sql/extensions/mysql.rb +2 -0
  34. data/lib/rom/sql/extensions/mysql/type_builder.rb +2 -0
  35. data/lib/rom/sql/extensions/postgres.rb +3 -0
  36. data/lib/rom/sql/extensions/postgres/commands.rb +3 -1
  37. data/lib/rom/sql/extensions/postgres/type_builder.rb +6 -4
  38. data/lib/rom/sql/extensions/postgres/type_serializer.rb +2 -0
  39. data/lib/rom/sql/extensions/postgres/types.rb +2 -0
  40. data/lib/rom/sql/extensions/postgres/types/array.rb +7 -6
  41. data/lib/rom/sql/extensions/postgres/types/array_types.rb +3 -1
  42. data/lib/rom/sql/extensions/postgres/types/geometric.rb +2 -0
  43. data/lib/rom/sql/extensions/postgres/types/json.rb +76 -19
  44. data/lib/rom/sql/extensions/postgres/types/ltree.rb +25 -23
  45. data/lib/rom/sql/extensions/postgres/types/network.rb +2 -0
  46. data/lib/rom/sql/extensions/postgres/types/range.rb +2 -0
  47. data/lib/rom/sql/extensions/rails_log_subscriber.rb +2 -0
  48. data/lib/rom/sql/extensions/sqlite.rb +2 -0
  49. data/lib/rom/sql/extensions/sqlite/type_builder.rb +2 -0
  50. data/lib/rom/sql/extensions/sqlite/types.rb +2 -0
  51. data/lib/rom/sql/foreign_key.rb +3 -1
  52. data/lib/rom/sql/function.rb +38 -6
  53. data/lib/rom/sql/gateway.rb +9 -1
  54. data/lib/rom/sql/group_dsl.rb +2 -0
  55. data/lib/rom/sql/index.rb +2 -0
  56. data/lib/rom/sql/join_dsl.rb +2 -0
  57. data/lib/rom/sql/mapper_compiler.rb +12 -1
  58. data/lib/rom/sql/migration.rb +5 -3
  59. data/lib/rom/sql/migration/inline_runner.rb +2 -0
  60. data/lib/rom/sql/migration/migrator.rb +4 -2
  61. data/lib/rom/sql/migration/recorder.rb +2 -0
  62. data/lib/rom/sql/migration/runner.rb +4 -2
  63. data/lib/rom/sql/migration/schema_diff.rb +2 -0
  64. data/lib/rom/sql/migration/template.rb +2 -0
  65. data/lib/rom/sql/migration/writer.rb +12 -4
  66. data/lib/rom/sql/order_dsl.rb +2 -0
  67. data/lib/rom/sql/plugin/associates.rb +4 -2
  68. data/lib/rom/sql/plugin/nullify.rb +37 -0
  69. data/lib/rom/sql/plugin/pagination.rb +2 -0
  70. data/lib/rom/sql/plugins.rb +4 -0
  71. data/lib/rom/sql/projection_dsl.rb +3 -1
  72. data/lib/rom/sql/rake_task.rb +2 -0
  73. data/lib/rom/sql/relation.rb +3 -1
  74. data/lib/rom/sql/relation/reading.rb +32 -6
  75. data/lib/rom/sql/relation/writing.rb +2 -0
  76. data/lib/rom/sql/restriction_dsl.rb +9 -1
  77. data/lib/rom/sql/schema.rb +16 -2
  78. data/lib/rom/sql/schema/attributes_inferrer.rb +5 -3
  79. data/lib/rom/sql/schema/dsl.rb +3 -1
  80. data/lib/rom/sql/schema/index_dsl.rb +5 -2
  81. data/lib/rom/sql/schema/inferrer.rb +12 -8
  82. data/lib/rom/sql/schema/type_builder.rb +4 -2
  83. data/lib/rom/sql/spec/support.rb +5 -3
  84. data/lib/rom/sql/tasks/migration_tasks.rake +16 -11
  85. data/lib/rom/sql/transaction.rb +2 -0
  86. data/lib/rom/sql/type_dsl.rb +2 -0
  87. data/lib/rom/sql/type_extensions.rb +4 -4
  88. data/lib/rom/sql/type_serializer.rb +2 -0
  89. data/lib/rom/sql/types.rb +2 -0
  90. data/lib/rom/sql/version.rb +3 -1
  91. data/lib/rom/sql/wrap.rb +2 -0
  92. data/lib/rom/types/values.rb +2 -0
  93. metadata +34 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ca5db918213ed1a81ec7e5b526849393a4f6223cb4107a2ee1ea54cc6148b81
4
- data.tar.gz: e1742760f02aad6e90025742b3d8d91c2f52d94e495b398e4886431b82d61a71
3
+ metadata.gz: ddc33a4e8bd74212636e3c07be5ee12ab1e8947d4e5f76a3981c31c577140697
4
+ data.tar.gz: '097637bec7bac21c61128ed798ae0038e7f19ffed9579e89d596243f4b3f8bc0'
5
5
  SHA512:
6
- metadata.gz: 73d5948cbae27d6032552805bcad6365d52c18784d0cfeb86391890e89de9d5902c4154898ab96bfc32481aec8e5e6f555febc38faecd8983163a0902897b4ad
7
- data.tar.gz: 7ada4412f647ff39c116044320bdb253fcebc5696caed50cb8158e1be8f440d221af2b601708f1fc06297e818c1e1e1af61d0fbeaa8bb9c949d87f7df7d9aca9
6
+ metadata.gz: 279b99442b0b5b6434c2d5cbf9817e1e04b62897cdf485cbbc1164259336d47bf621e98a2b2a5f648d61ef0e0fa7f5c9f7dfcec2b448f33db49f41b1e1295352
7
+ data.tar.gz: 466bbb815b90464ada9de31e040e36d91e75c9a34d9d36d8bb85f639fc1808318d87ab91e037bf0ee69a03433a4326ef6640eda323b6bceaf5b0f473cbffa4e6
@@ -1,16 +1,102 @@
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 3.3.2 2020-01-06
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Function qualification methods no longer lose options (issue #390 fixed via #391) (@solnic)
9
+
10
+
11
+ [Compare v3.3.1...v3.3.2](https://github.com/rom-rb/rom-sql/compare/v3.3.1...v3.3.2)
12
+
13
+ ## 3.3.1 2020-12-29
14
+
15
+
16
+ ### Fixed
17
+
18
+ - `:pg_streaming` plugin no longer crashes when there's no sequel_pg and now you need to require the plugin explicitly (@solnic)
19
+
20
+
21
+ [Compare v3.3.0...v3.3.1](https://github.com/rom-rb/rom-sql/compare/v3.3.0...v3.3.1)
22
+
23
+ ## 3.3.0 2020-12-28
24
+
25
+
26
+ ### Added
27
+
28
+ - `Relation#full_text_search` that provides an API for [PostgreSQL's Full Text Search](https://www.postgresql.org/docs/9.5/textsearch.html) (@ianks)
29
+
30
+ ```ruby
31
+ # Don't forget to activate the plugin
32
+ conf.plugin(:sql, relations: :pg_full_text_search)
33
+
34
+ posts.full_text_search([:title], 'tutorials', language: 'english')
35
+ # => [{ title: 'A Tutorial about SQL', ... }]
36
+ ```
37
+ - Support for `:pg_streaming` extension (@ianks)
38
+
39
+ ### Fixed
40
+
41
+ - `Relation#join` no longer crashes when aliased relation is used with a block (issue #369) (@abrthel)
42
+ - Attributes aliases are properly handled when constructing queries with SQL functions (issue #370 fixed via #373) (@abrthel)
43
+
44
+
45
+ [Compare v3.2.0...v3.3.0](https://github.com/rom-rb/rom-sql/compare/v3.2.0...v3.3.0)
46
+
47
+ ## 3.2.0 2020-01-11
48
+
49
+
50
+ ### Fixed
51
+
52
+ - Keyword warnings on Ruby 2.7 (@flash-gordon)
53
+
54
+
55
+ [Compare v3.1.0...v3.2.0](https://github.com/rom-rb/rom-sql/compare/v3.1.0...v3.2.0)
56
+
57
+ ## 3.1.0 2019-12-16
58
+
59
+
60
+ ### Added
61
+
62
+ - `.nullify` that turns the result set of any relation into an empty set. Analogue of `ActiveRecord#none` (@ianks + @flash-gordon)
63
+
64
+ ```ruby
65
+ # Don't forget to activate the plugin
66
+ conf.relation(:users) do
67
+ use :nullify
68
+ end
69
+
70
+ users.nullify.count # => will always be 0
71
+ users.nullify.to_a # => will always be empty ([])
72
+ ```
73
+
74
+ ### Fixed
75
+
76
+ - Make `Relation#wrap` respect association views (@ianks)
77
+ - Primitive JSON-compatible values such as Integer and String are automatically coerced to correct JSONB values and back if you're using a recent Sequel version (>= 5.2.0) (@flash-gordon)
78
+ - Properly qualify relations when in `Relation#union` (@ianks)
79
+ - `Relation#query` no longer removes order in the relation (@DNNX)
80
+
81
+
82
+ [Compare v3.0.1...v3.1.0](https://github.com/rom-rb/rom-sql/compare/v3.0.1...v3.1.0)
83
+
1
84
  ## 3.0.1 2019-05-05
2
85
 
86
+
3
87
  ### Fixed
4
88
 
5
- * Using joins with a relation object as the target and a block-based conditions produces correct query now (issue #331) (solnic)
89
+ - Using joins with a relation object as the target and a block-based conditions produces correct query now (issue #331) (solnic)
90
+
6
91
 
7
92
  [Compare v3.0.0...v3.0.1](https://github.com/rom-rb/rom-sql/compare/v3.0.0...v3.0.1)
8
93
 
9
94
  ## 3.0.0 2019-04-24
10
95
 
96
+
11
97
  ### Added
12
98
 
13
- * Join DSL so that you can use arbitrary conditions when joining relations (flash-gordon)
99
+ - Join DSL so that you can use arbitrary conditions when joining relations (flash-gordon)
14
100
  ```ruby
15
101
  users.join(tasks) { |users:, tasks:|
16
102
  tasks[:user_id].is(users[:id]) & users[:name].is('John')
@@ -24,7 +110,8 @@
24
110
  users[:id].is(authors[:id])
25
111
  }.select(:name)
26
112
  ```
27
- * Support for `CASE` expression (wmaciejak + flash-gordon)
113
+ - Support for `CASE` expression (wmaciejak + flash-gordon)
114
+
28
115
  ```ruby
29
116
  # matching expression result
30
117
  users.select_append { id.case(1 => string('one'), else: string('something else')).as(:one_or_else) }
@@ -32,129 +119,137 @@
32
119
  # searching for `true` result
33
120
  users.select_append { string::case(id.is(1) => 'one', else: 'else').as(:one_or_else) }
34
121
  ```
35
- * Relations can be accessed in DSLs with keyword arguments (flash-gordon)
122
+ - Relations can be accessed in DSLs with keyword arguments (flash-gordon)
36
123
  ```ruby
37
124
  users.join(posts).select_append { |posts: | posts[:title] }
38
125
  ```
39
- * Support for `.exists` in the projection DSL (flash-gordon)
126
+ - Support for `.exists` in the projection DSL (flash-gordon)
40
127
  ```ruby
41
128
  users.select_append { |posts: |
42
129
  exists(posts.where(posts[:user_id] => id)).as(:has_posts)
43
130
  }
44
131
  ```
45
- * `Relation#unfiltered` returns an unrestricted relation (removes restrictions from `WHERE` and `HAVING`) (flash-gordon)
46
- * Support for `WITHIN GROUP` in the function DSL has been enhanced with block syntax (flash-gordon)
47
- ```ruby
48
- # previously available version
49
- households.project { float::percentile_cont(0.5).within_group(income).as(:percentile) }
50
- # using the new syntax
51
- households.project { float::percentile_cont(0.5).within_group { income }.as(:percentile) }
52
- ```
53
- * Support for migrator options ie `ROM::Configuration.new(:sql, migrator: { path: "my_migrations" })` (rawburt)
54
- * `Relation#pluck` works with multiple args too (timriley)
55
-
56
- ### Changed
57
-
58
- * [BREAKING] Updated to work with `dry-types 1.0.0` (flash-gordon)
59
- * [BREAKING] `Types::Int` is now `Types::Integer` (GustavoCaso)
132
+ - `Relation#unfiltered` returns an unrestricted relation (removes restrictions from `WHERE` and `HAVING`) (flash-gordon)
133
+ - Support for `WITHIN GROUP` in the function DSL has been enhanced with block syntax (flash-gordon)
134
+ - ```ruby
135
+ - # previously available version
136
+ - households.project { float::percentile_cont(0.5).within_group(income).as(:percentile) }
137
+ - # using the new syntax
138
+ - households.project { float::percentile_cont(0.5).within_group { income }.as(:percentile) }
139
+ - ```
140
+ - Support for migrator options ie `ROM::Configuration.new(:sql, migrator: { path: "my_migrations" })` (rawburt)
141
+ - `Relation#pluck` works with multiple args too (timriley)
60
142
 
61
143
  ### Fixed
62
144
 
63
145
  - Using `Relation#inner_join` with has-many-through produces correct query (issue #279) (doriantaylor + solnic)
64
146
  - Aliased attributes are handled correctly in `Relation#where` (waiting-for-dev)
65
147
 
148
+ ### Changed
149
+
150
+ - [BREAKING] Updated to work with `dry-types 1.0.0` (flash-gordon)
151
+ - [BREAKING] `Types::Int` is now `Types::Integer` (GustavoCaso)
152
+
66
153
  [Compare v2.5.0...v3.0.0](https://github.com/rom-rb/rom-sql/compare/v2.5.0...v3.0.0)
67
154
 
68
- ## v2.5.0 2018-06-08
155
+ ## 2.5.0 2018-06-08
156
+
69
157
 
70
158
  ### Added
71
159
 
72
- * Support for subqueries in `SELECT` and `WHERE` :tada: (flash-gordon)
160
+ - Support for subqueries in `SELECT` and `WHERE` :tada: (flash-gordon)
73
161
  ```ruby
74
162
  tasks = relations[:tasks]
75
163
  users = relations[:users]
76
164
  user_tasks = tasks.where(tasks[:user_id].is(users[:id])
77
- tasks_count = user_tasks.select { integer::count(id) }
165
+ tasks_count = user_tasks.select { integer::count(id) }.query
78
166
  users.select_append(tasks_count.as(:tasks_count))
79
167
  ```
80
168
 
169
+
81
170
  [Compare v2.4.0...v2.5.0](https://github.com/rom-rb/rom-sql/compare/v2.4.0...v2.5.0)
82
171
 
83
- ## v2.4.0 2018-02-18
172
+ ## 2.4.0 2018-02-18
173
+
84
174
 
85
175
  ### Added
86
176
 
87
- * Support for functions with `Any` return type (GustavoCaso)
88
- * New `Relation#as_hash` method (GustavoCaso)
177
+ - Support for functions with `Any` return type (GustavoCaso)
178
+ - New `Relation#as_hash` method (GustavoCaso)
179
+
89
180
 
90
181
  [Compare v2.3.0...v2.4.0](https://github.com/rom-rb/rom-sql/compare/v2.3.0...v2.4.0)
91
182
 
92
- ## v2.3.0 2017-11-17
183
+ ## 2.3.0 2017-11-17
184
+
93
185
 
94
186
  ### Added
95
187
 
96
- * Command's `:timestamp` plugin now supports passing options (GustavoCaso)
97
- * Configuration supports hash with connection options (Kjarrigan + solnic)
188
+ - Command's `:timestamp` plugin now supports passing options (GustavoCaso)
189
+ - Configuration supports hash with connection options (Kjarrigan + solnic)
98
190
 
99
191
  ### Fixed
100
192
 
101
- * Aliased attributes are handled correctly in PG's commands (cflipse)
102
- * Command extensions are properly applied in multi-adapter setups (solnic)
103
-
104
- ### Internal
193
+ - Aliased attributes are handled correctly in PG's commands (cflipse)
194
+ - Command extensions are properly applied in multi-adapter setups (solnic)
105
195
 
106
- * Custom SQL-specific mapper compiler was added, which is used starting from rom-core 4.1.0 (solnic)
107
- * Command's `:timestamp` plugin was removed, as it was moved to rom-core (GustavoCaso)
108
196
 
109
197
  [Compare v2.2.1...v2.3.0](https://github.com/rom-rb/rom-sql/compare/v2.2.1...v2.3.0)
110
198
 
111
- ## v2.2.1 2017-11-10
199
+ ## 2.2.1 2017-11-10
200
+
112
201
 
113
202
  ### Fixed
114
203
 
115
- * Instrumentation works with all db interactions (not just queries that materialize relations) (solnic)
116
- * Typo in `MissingEnv` exception message (romatr)
204
+ - Instrumentation works with all db interactions (not just queries that materialize relations) (solnic)
205
+ - Typo in `MissingEnv` exception message (romatr)
206
+
117
207
 
118
208
  [Compare v2.2.0...v2.2.1](https://github.com/rom-rb/rom-sql/compare/v2.2.0...v2.2.1)
119
209
 
120
- ## v2.2.0 2017-11-02
210
+ ## 2.2.0 2017-11-02
211
+
121
212
 
122
213
  ### Added
123
214
 
124
- * Relation registry is passed as an argument to DSL blocks (in `select`, `where`, `order` etc.), which enables syntax like `select { |r| [id, r.tasks[:title]] }` (solnic)
125
- * Support for self-referenced many-to-many associations (solnic)
126
- * PG's geometric types include meta data about db types (GustavoCaso)
215
+ - Relation registry is passed as an argument to DSL blocks (in `select`, `where`, `order` etc.), which enables syntax like `select { |r| [id, r.tasks[:title]] }` (solnic)
216
+ - Support for self-referenced many-to-many associations (solnic)
217
+ - PG's geometric types include meta data about db types (GustavoCaso)
127
218
 
128
219
  ### Fixed
129
220
 
130
- * Custom schema is used correctly in command results (solnic)
131
- * Schemas no longer finalize PKs (this is done in core schema already) (solnic)
221
+ - Custom schema is used correctly in command results (solnic)
222
+ - Schemas no longer finalize PKs (this is done in core schema already) (solnic)
223
+
132
224
 
133
225
  [Compare v2.1.0...v2.2.0](https://github.com/rom-rb/rom-sql/compare/v2.1.0...v2.2.0)
134
226
 
135
- ## v2.1.0 2017-10-23
227
+ ## 2.1.0 2017-10-23
228
+
136
229
 
137
230
  ### Added
138
231
 
139
- * Support for PG's range types (v-kolesnikov)
140
- * Support for PG's `ltree` (GustavoCaso + solnic)
141
- * Support for the `FILTER` clause (flash-gordon)
142
- * PG's array types will use custom types for processing members ie `ltree[]` will use `LTree` type (solnic)
232
+ - Support for PG's range types (v-kolesnikov)
233
+ - Support for PG's `ltree` (GustavoCaso + solnic)
234
+ - Support for the `FILTER` clause (flash-gordon)
235
+ - PG's array types will use custom types for processing members ie `ltree[]` will use `LTree` type (solnic)
143
236
 
144
237
  ### Fixed
145
238
 
146
- * Schema inference works with primary keys that have custom types (ie an enum PK column) (v-kolesnikov)
147
- * Ruby warnings are gone (solnic)
239
+ - Schema inference works with primary keys that have custom types (ie an enum PK column) (v-kolesnikov)
240
+ - Ruby warnings are gone (solnic)
241
+
148
242
 
149
243
  [Compare v2.0.0...v2.1.0](https://github.com/rom-rb/rom-sql/compare/v2.0.0...v2.1.0)
150
244
 
151
- ## v2.0.0 2017-10-18
245
+ ## 2.0.0 2017-10-18
246
+
152
247
 
153
248
  ### Added
154
249
 
155
- * Support for schema plugins (flash-gordon)
156
- * Support for auto migrations (flash-gordon)
157
- * Add DLS for describing table indexes (flash-gordon)
250
+ - Support for schema plugins (flash-gordon)
251
+ - Support for auto migrations (flash-gordon)
252
+ - Add DLS for describing table indexes (flash-gordon)
158
253
 
159
254
  ```ruby
160
255
  schema do
@@ -166,28 +261,24 @@
166
261
  end
167
262
  end
168
263
  ```
169
-
170
- * Support for composite indexes in the auto-restrictions plugin (flash-gordon)
171
- * `SQL::Gateway#call` calls a SQL function (flash-gordon)
264
+ - Support for composite indexes in the auto-restrictions plugin (flash-gordon)
265
+ - `SQL::Gateway#call` calls a SQL function (flash-gordon)
172
266
 
173
267
  ```ruby
174
268
  gateway.(:upper, 'foo') # => "FOO"
175
269
  gateway.(:pg_advisory_xact_lock, 1234) # => nil
176
270
  ```
177
-
178
- * `SQL::Gateway#run` executes a SQL string, e.g. a DDL statement (flash-gordon)
271
+ - `SQL::Gateway#run` executes a SQL string, e.g. a DDL statement (flash-gordon)
179
272
 
180
273
  ```ruby
181
274
  gateway.run('set session IntervalStyle to default')
182
275
  ```
183
-
184
- * `SQL::Relation#exists` joins a relation with the `EXISTS` operator (flash-gordon)
276
+ - `SQL::Relation#exists` joins a relation with the `EXISTS` operator (flash-gordon)
185
277
 
186
278
  ```ruby
187
279
  users.exists(posts) # => users with posts
188
280
  ```
189
-
190
- * Support for processing a relation in batches (flash-gordon)
281
+ - Support for processing a relation in batches (flash-gordon)
191
282
 
192
283
  ```ruby
193
284
  users.each_batch(size: 100) do |rel|
@@ -196,69 +287,64 @@
196
287
  call(name: users[:first_name].concat(users[:last_name])
197
288
  end
198
289
  ```
199
-
200
- * `SQL::Relation#import` inserts data from another relation using the `INSERT ... AS SELECT` syntax which is often far more effective than row-by-row processing and an ordinary multi-insert. Relations defined on another gateway are also supported, and in this case, the implementation falls back to the multi-insert strategy (flash-gordon)
290
+ - `SQL::Relation#import` inserts data from another relation using the `INSERT ... AS SELECT` syntax which is often far more effective than row-by-row processing and an ordinary multi-insert. Relations defined on another gateway are also supported, and in this case, the implementation falls back to the multi-insert strategy (flash-gordon)
201
291
 
202
292
  ```ruby
203
293
  users.import(authors.select { first_name.concat(last_name).as(:name) })
204
294
  ```
205
-
206
- * Support for `tinytext`, `text`, `mediumtext`, and `longtext data types in MySQL (panthomakos)
207
- * The new `pg_explain` plugin for getting query plans on PostgreSQL (flash-gordon)
295
+ - Support for `tinytext`, `text`, `mediumtext`, and `longtext data types in MySQL (panthomakos)
296
+ - The new `pg_explain` plugin for getting query plans on PostgreSQL (flash-gordon)
208
297
 
209
298
  ```ruby
210
299
  users.by_pk(1).explain(format: :json, analyze: true)
211
300
  ```
212
-
213
- * Support for window function calls
301
+ - Support for window function calls
214
302
 
215
303
  ```ruby
216
304
  employees.select { [dep_no, salary, integer::avg(salary).over(partition: dep_no, order: id).as(:avg_salary)] }
217
305
  ```
218
-
219
- * Function result can be negated, also `ROM::SQL::Function#not` was added (flash-gordon)
306
+ - Function result can be negated, also `ROM::SQL::Function#not` was added (flash-gordon)
220
307
 
221
308
  ```ruby
222
309
  users.where { !lower(name).is('John') }
223
310
  users.where { lower(name).not('John') }
224
311
  ```
225
312
 
313
+ ### Fixed
226
314
 
227
- ### Changed
315
+ - Self-ref associations work correctly with custom FKs (solnic)
316
+ - Aliased associations with custom FKs work correctly (solnic)
317
+ - Defining a custom dataset block no longer prevents default views like `by_pk` to be defined (solnic)
318
+ - `Relation#group` uses canonical schema now (solnic)
228
319
 
229
- * [BREAKING] based on rom 4.0 now (flash-gordon + solnic)
230
- * [BREAKING] `Associates` command plugin requires associations now (solnic)
231
- * [BREAKING] `Command#transaction` is gone in favor of `Relation#transaction` (solnic)
232
- * [BREAKING] `PG::JSONArray`, `PG::JSONBArray`, `PG::JSONHash`, and `PG::JSONBHash` types were dropped, use `PG::JSON` and `PG::JSONB` instead (flash-gordon)
233
- * [BREAKING] The `pg_hstore` extension now doesn't get loaded automatically, use the `:extension` option to load it on config initialization (flash-gordon)
234
- * `ManyToOne` no longer uses a join (solnic)
235
- * `AutoCombine` and `AutoWrap` plugins were removed as this functionality is provided by core API (solnic)
236
- * Foreign keys are indexed by default (flash-gordon)
237
- * Schemas are qualified by default (solnic)
238
- * `PG::JSON`, `PG::JSONB`, and `PG::Array` now all have read types so that they return plain Hash/Array values instead of Sequel's wrappers (flash-gordon)
320
+ ### Changed
239
321
 
240
- ### Fixed
322
+ - [BREAKING] based on rom 4.0 now (flash-gordon + solnic)
323
+ - [BREAKING] `Associates` command plugin requires associations now (solnic)
324
+ - [BREAKING] `Command#transaction` is gone in favor of `Relation#transaction` (solnic)
325
+ - [BREAKING] `PG::JSONArray`, `PG::JSONBArray`, `PG::JSONHash`, and `PG::JSONBHash` types were dropped, use `PG::JSON` and `PG::JSONB` instead (flash-gordon)
326
+ - [BREAKING] The `pg_hstore` extension now doesn't get loaded automatically, use the `:extension` option to load it on config initialization (flash-gordon)
327
+ - `ManyToOne` no longer uses a join (solnic)
328
+ - `AutoCombine` and `AutoWrap` plugins were removed as this functionality is provided by core API (solnic)
329
+ - Foreign keys are indexed by default (flash-gordon)
330
+ - Schemas are qualified by default (solnic)
331
+ - `PG::JSON`, `PG::JSONB`, and `PG::Array` now all have read types so that they return plain Hash/Array values instead of Sequel's wrappers (flash-gordon)
241
332
 
242
- * Self-ref associations work correctly with custom FKs (solnic)
243
- * Aliased associations with custom FKs work correctly (solnic)
244
- * Defining a custom dataset block no longer prevents default views like `by_pk` to be defined (solnic)
245
- * `Relation#group` uses canonical schema now (solnic)
333
+ [Compare v1.3.3...v2.0.0](https://github.com/rom-rb/rom-sql/compare/v1.3.3...v2.0.0)
246
334
 
247
- [Compare v1.3.3...master](https://github.com/rom-rb/rom-sql/compare/v1.3.3...master)
335
+ ## 1.3.3 2017-05-30
248
336
 
249
- ## v1.3.3 2017-05-30
250
337
 
251
338
  ### Added
252
339
 
253
- * `Relation#lock`, row-level locking using the `SELECT FOR UPDATE` clause (flash-gordon)
254
- * `get` and `get_text` methods for the `PG::JSON` type (flash-gordon)
255
- * Support for converting data type with `CAST` using the function DSL (flash-gordon)
340
+ - `Relation#lock`, row-level locking using the `SELECT FOR UPDATE` clause (flash-gordon)
341
+ - `get` and `get_text` methods for the `PG::JSON` type (flash-gordon)
342
+ - Support for converting data type with `CAST` using the function DSL (flash-gordon)
256
343
 
257
344
  ```ruby
258
345
  users.select { string::cast(id, 'varchar').as(:id_str) }
259
346
  ```
260
-
261
- * Support for`EXISTS` (v-kolesnikov)
347
+ - Support for`EXISTS` (v-kolesnikov)
262
348
 
263
349
  ```ruby
264
350
  subquery = tasks.where(tasks[:user_id].qualified => users[:id].qualified)
@@ -267,52 +353,57 @@
267
353
 
268
354
  ### Fixed
269
355
 
270
- * Fixed a regression introduced in v1.3.2 caused by doing way more work processing the default dataset (flash-gordon)
356
+ - Fixed a regression introduced in v1.3.2 caused by doing way more work processing the default dataset (flash-gordon)
357
+
271
358
 
272
359
  [Compare v1.3.2...v1.3.3](https://github.com/rom-rb/rom-sql/compare/v1.3.2...v1.3.3)
273
360
 
274
- ## v1.3.2 2017-05-13
361
+ ## 1.3.2 2017-05-13
362
+
275
363
 
276
364
  ### Added
277
365
 
278
- * Support for filtering with a SQL function in the `WHERE` clause. Be sure you're using it wisely and don't call it on large datasets ;) (flash-gordon)
279
- * `Void` type for calling functions without returning value (flash-gordon)
280
- * Support for [`PG::Array` transformations and queries](https://github.com/rom-rb/rom-sql/blob/15019a40e2cf2a224476184c4cddab4062a2cc01/lib/rom/sql/extensions/postgres/types.rb#L23-L148) (flash-gordon)
366
+ - Support for filtering with a SQL function in the `WHERE` clause. Be sure you're using it wisely and don't call it on large datasets ;) (flash-gordon)
367
+ - `Void` type for calling functions without returning value (flash-gordon)
368
+ - Support for [`PG::Array` transformations and queries](https://github.com/rom-rb/rom-sql/blob/15019a40e2cf2a224476184c4cddab4062a2cc01/lib/rom/sql/extensions/postgres/types.rb#L23-L148) (flash-gordon)
281
369
 
282
370
  ### Fixed
283
371
 
284
- * A bunch of warnings from Sequel 4.46
372
+ - A bunch of warnings from Sequel 4.46
373
+
285
374
 
286
375
  [Compare v1.3.1...v1.3.2](https://github.com/rom-rb/rom-sql/compare/v1.3.1...v1.3.2)
287
376
 
288
- ## v1.3.1 2017-05-05
377
+ ## 1.3.1 2017-05-05
378
+
289
379
 
290
380
  ### Changed
291
381
 
292
- * [internal] Compatibility with `dry-core` v0.3.0 (flash-gordon)
382
+ - [internal] Compatibility with `dry-core` v0.3.0 (flash-gordon)
293
383
 
294
384
  [Compare v1.3.0...v1.3.1](https://github.com/rom-rb/rom-sql/compare/v1.3.0...v1.3.1)
295
385
 
296
- ## v1.3.0 2017-05-02
386
+ ## 1.3.0 2017-05-02
387
+
297
388
 
298
389
  ### Added
299
390
 
300
- * New `Relation#exist?` predicate checks if the relation has at least one tuple (flash-gordon)
301
- * Support for [JSONB transformations and queries](https://github.com/rom-rb/rom-sql/blob/15019a40e2cf2a224476184c4cddab4062a2cc01/lib/rom/sql/extensions/postgres/types.rb#L170-L353) using native DSL (flash-gordon)
302
- * Add `ROM::SQL::Attribute#not` for negated boolean equality expressions (AMHOL)
303
- * Add `ROM::SQL::Attribute#!` for negated attribute's sql expressions (solnic)
304
- * Inferrer gets limit constraints for string data types and stores them in type's meta (v-kolesnikov)
391
+ - New `Relation#exist?` predicate checks if the relation has at least one tuple (flash-gordon)
392
+ - Support for [JSONB transformations and queries](https://github.com/rom-rb/rom-sql/blob/15019a40e2cf2a224476184c4cddab4062a2cc01/lib/rom/sql/extensions/postgres/types.rb#L170-L353) using native DSL (flash-gordon)
393
+ - Add `ROM::SQL::Attribute#not` for negated boolean equality expressions (AMHOL)
394
+ - Add `ROM::SQL::Attribute#!` for negated attribute's sql expressions (solnic)
395
+ - Inferrer gets limit constraints for string data types and stores them in type's meta (v-kolesnikov)
305
396
 
306
397
  ### Fixed
307
398
 
308
- * Fixed usage of PostgreSQL's commands with a composite relation (flash-gordon)
309
- * Translation of `true/false/nil` equality checks to `is/is not` SQL statements in `ROM::SQL::Attribute#is` (AMHOL)
310
- * `associates` command plugin coerces parent collections to hashes correctly (aarek+solnic)
311
- * `by_pk` works correctly even when PK is not projected (solnic)
399
+ - Fixed usage of PostgreSQL's commands with a composite relation (flash-gordon)
400
+ - Translation of `true/false/nil` equality checks to `is/is not` SQL statements in `ROM::SQL::Attribute#is` (AMHOL)
401
+ - `associates` command plugin coerces parent collections to hashes correctly (aarek+solnic)
402
+ - `by_pk` works correctly even when PK is not projected (solnic)
312
403
 
313
404
  ### Changed
314
405
 
315
- * Global private interface `SQL::Gateway.instance` has been deprecated. Now if you run migrations
406
+ - Global private interface `SQL::Gateway.instance` has been deprecated. Now if you run migrations
316
407
  with ROM you should set up a ROM config in the `db:setup` task with something similar to
317
408
 
318
409
  ```ruby
@@ -325,410 +416,450 @@
325
416
 
326
417
  [Compare v1.2.2...v1.3.0](https://github.com/rom-rb/rom-sql/compare/v1.2.2...v1.3.0)
327
418
 
328
- ## v1.2.2 2017-03-25
419
+ ## 1.2.2 2017-03-25
420
+
329
421
 
330
422
  ### Changed
331
423
 
332
- * Updated `dry-initializer` (flash-gordon)
424
+ - Updated `dry-initializer` (flash-gordon)
333
425
 
334
426
  [Compare v1.2.1...v1.2.2](https://github.com/rom-rb/rom-sql/compare/v1.2.1...v1.2.2)
335
427
 
336
- ## v1.2.1 2017-03-09
428
+ ## 1.2.1 2017-03-09
429
+
337
430
 
338
431
  ### Fixed
339
432
 
340
- * Allow for joining by a `RelationProxy` instance from `rom-repository` (davydovanton)
433
+ - Allow for joining by a `RelationProxy` instance from `rom-repository` (davydovanton)
434
+
341
435
 
342
436
  [Compare v1.2.0...v1.2.1](https://github.com/rom-rb/rom-sql/compare/v1.2.0...v1.2.1)
343
437
 
344
- ## v1.2.0 2017-03-07
438
+ ## 1.2.0 2017-03-07
439
+
345
440
 
346
441
  ### Added
347
442
 
348
- * Support for configuring multiple associations for a command (solnic)
349
- * Support for passing parent tuple(s) as `parent` option in `Command#with_association` (solnic)
350
- * Support for join using assocation name (flash-gordon)
443
+ - Support for configuring multiple associations for a command (solnic)
444
+ - Support for passing parent tuple(s) as `parent` option in `Command#with_association` (solnic)
445
+ - Support for join using assocation name (flash-gordon)
446
+
351
447
 
352
448
  [Compare v1.1.2...v1.2.0](https://github.com/rom-rb/rom-sql/compare/v1.1.2...v1.2.0)
353
449
 
354
- ## v1.1.2 2017-03-02
450
+ ## 1.1.2 2017-03-02
451
+
355
452
 
356
453
  ### Fixed
357
454
 
358
- * Fix grouping by a function in the block DSL (flash-gordon)
455
+ - Fix grouping by a function in the block DSL (flash-gordon)
456
+
359
457
 
360
458
  [Compare v1.1.1...v1.1.2](https://github.com/rom-rb/rom-sql/compare/v1.1.1...v1.1.2)
361
459
 
362
- ## v1.1.1 2017-03-01
460
+ ## 1.1.1 2017-03-01
461
+
363
462
 
364
463
  ### Fixed
365
464
 
366
- * Restriction conditions with an array as a value are handled correctly by attribute types (solnic)
465
+ - Restriction conditions with an array as a value are handled correctly by attribute types (solnic)
466
+
367
467
 
368
468
  [Compare v1.1.0...v1.1.1](https://github.com/rom-rb/rom-sql/compare/v1.1.0...v1.1.1)
369
469
 
370
- ## v1.1.0 2017-03-01
470
+ ## 1.1.0 2017-03-01
471
+
371
472
 
372
473
  ### Added
373
474
 
374
- * Added inferring for database indices (flash-gordon)
375
- * Restriction conditions are now coerced using schema attributes (solnic)
376
- * `:instrumentation` relation plugin that can be configured with any instrumentation backend (solnic)
377
- * `:auto_restrictions` relation plugin, which defines `by_*` views restricting relations by their indexed attributes (solnic)
475
+ - Added inferring for database indices (flash-gordon)
476
+ - Restriction conditions are now coerced using schema attributes (solnic)
477
+ - `:instrumentation` relation plugin that can be configured with any instrumentation backend (solnic)
478
+ - `:auto_restrictions` relation plugin, which defines `by_*` views restricting relations by their indexed attributes (solnic)
378
479
 
379
480
  ### Fixed
380
481
 
381
- * Missing `group` method was added to legacy `SequelAPI` module (solnic)
382
- * Associations properly maintain `order` if it was set (solnic)
482
+ - Missing `group` method was added to legacy `SequelAPI` module (solnic)
483
+ - Associations properly maintain `order` if it was set (solnic)
484
+
383
485
 
384
486
  [Compare v1.0.3...v1.1.0](https://github.com/rom-rb/rom-sql/compare/v1.0.3...v1.1.0)
385
487
 
386
- ## v1.0.3 2017-02-23
488
+ ## 1.0.3 2017-02-23
387
489
 
388
- ### Changed
389
-
390
- * `AutoCombine#preload` uses better restriction for `ManyToOne` association which greatly speeds up loading bigger amounts of data (solnic + flash-gordon)
391
490
 
392
491
  ### Fixed
393
492
 
394
- * Fix the usage of timestamp in command chains (cflipse)
493
+ - Fix the usage of timestamp in command chains (cflipse)
494
+
495
+ ### Changed
496
+
497
+ - `AutoCombine#preload` uses better restriction for `ManyToOne` association which greatly speeds up loading bigger amounts of data (solnic + flash-gordon)
395
498
 
396
499
  [Compare v1.0.2...v1.0.3](https://github.com/rom-rb/rom-sql/compare/v1.0.2...v1.0.3)
397
500
 
398
- ## v1.0.2 2017-02-16
501
+ ## 1.0.2 2017-02-16
502
+
399
503
 
400
504
  ### Added
401
505
 
402
- * Support for selecting literal strings via ``select { `'foo'`.as(:bar) }`` (solnic)
506
+ - Support for selecting literal strings via `` select { `'foo'`.as(:bar) } `` (solnic)
507
+
403
508
 
404
509
  [Compare v1.0.1...v1.0.2](https://github.com/rom-rb/rom-sql/compare/v1.0.1...v1.0.2)
405
510
 
406
- ## v1.0.1 2017-02-09
511
+ ## 1.0.1 2017-02-09
512
+
407
513
 
408
514
  ### Added
409
515
 
410
- * Support for inferring the PostgreSQL `hstore` data type (flash-gordon)
411
- * Support for the rest of geometric PostgreSQL data types (box, lseg, polygon, etc.) (Morozzzko)
412
- * Added inferring for timestamp types with specified precision (flash-gordon)
413
- * Added `ROM::SQL::Attribute#in` to support range checks in conditions (flash-gordon)
516
+ - Support for inferring the PostgreSQL `hstore` data type (flash-gordon)
517
+ - Support for the rest of geometric PostgreSQL data types (box, lseg, polygon, etc.) (Morozzzko)
518
+ - Added inferring for timestamp types with specified precision (flash-gordon)
519
+ - Added `ROM::SQL::Attribute#in` to support range checks in conditions (flash-gordon)
414
520
 
415
521
  ### Fixed
416
522
 
417
- * Missing primary key now leads to a more meaningful error (flash-gordon)
523
+ - Missing primary key now leads to a more meaningful error (flash-gordon)
418
524
 
419
- [Compare v1.0.0...v1.0.1](https://github.com/rom-rb/rom-sql/compare/v1.0.0...v1.0.1)
420
525
 
421
- ## v1.0.0 2017-01-29
526
+ [Compare v1.0.0...v1.0.1](https://github.com/rom-rb/rom-sql/compare/v1.0.0...v1.0.1)
422
527
 
423
- This release is based on rom core 3.0.0 with its improved Schema API, which is extended with SQL-specific features.
528
+ ## 1.0.0 2017-01-29
424
529
 
425
530
  Please refer to [the upgrading guide](https://github.com/rom-rb/rom-sql/wiki/Upgrading-from-0.9.x-to-1.0.0) if you're moving from 0.9.x to 1.0.0.
426
531
 
427
532
  ### Added
428
533
 
429
- * [BREAKING] All relations have schemas (inferred by default, but still possible to override and/or extend) (solnic)
430
- * [BREAKING] Schemas are used when defining relation views (solnic)
431
- * [BREAKING] Default dataset is set up based on schema (solnic)
432
- * Extended query API with support for schema attributes (solnic)
433
- * Schemas can project relations automatically (solnic)
434
- * New `Schema#qualified` (solnic)
435
- * New `Relation#assoc` method which is a shortcut for accessing relation created by the given association (solnic)
436
- * Schema attribute types are now SQL-specific and compatible with query DSL (ie you can pass relation attributes to `select` and they will be automatically converted to valid SQL expressions) (solnic)
437
- * Associations support setting custom `view` that will be used to extend association relation (solnic)
438
- * Associations support setting custom `foreign_key` names (solnic)
439
- * Update commands has `:associates` plugin enabled (solnic)
440
- * Support for self-referencing associations (ie categories have_many child categories) (solnic)
441
- * Inferrers for mysql and sqlite were added (flash-gordon)
442
- * PG's auto-inferrer can handle `inet`/`cidr`/`point` data types in a two-way manner, i.e. converting them back and forth on reading and writing (flash-gordon)
443
- * Support for inferring more PG types: `macaddr`, `xml` (flash-gordon)
444
- * `ROM::SQL::Relation::SequelAPI` extension for backward-compatible query API (this will be deprecated in 1.1.0 and removed in 2.0.0) (solnic)
445
- * Added `Object` type for `SQLite` which is used by the inferrer for columns without a type affinity (flash-gordon)
446
- * Support for composite PKs in the default `by_pk` view (solnic)
534
+ - [BREAKING] All relations have schemas (inferred by default, but still possible to override and/or extend) (solnic)
535
+ - [BREAKING] Schemas are used when defining relation views (solnic)
536
+ - [BREAKING] Default dataset is set up based on schema (solnic)
537
+ - Extended query API with support for schema attributes (solnic)
538
+ - Schemas can project relations automatically (solnic)
539
+ - New `Schema#qualified` (solnic)
540
+ - New `Relation#assoc` method which is a shortcut for accessing relation created by the given association (solnic)
541
+ - Schema attribute types are now SQL-specific and compatible with query DSL (ie you can pass relation attributes to `select` and they will be automatically converted to valid SQL expressions) (solnic)
542
+ - Associations support setting custom `view` that will be used to extend association relation (solnic)
543
+ - Associations support setting custom `foreign_key` names (solnic)
544
+ - Update commands has `:associates` plugin enabled (solnic)
545
+ - Support for self-referencing associations (ie categories have_many child categories) (solnic)
546
+ - Inferrers for mysql and sqlite were added (flash-gordon)
547
+ - PG's auto-inferrer can handle `inet`/`cidr`/`point` data types in a two-way manner, i.e. converting them back and forth on reading and writing (flash-gordon)
548
+ - Support for inferring more PG types: `macaddr`, `xml` (flash-gordon)
549
+ - `ROM::SQL::Relation::SequelAPI` extension for backward-compatible query API (this will be deprecated in 1.1.0 and removed in 2.0.0) (solnic)
550
+ - Added `Object` type for `SQLite` which is used by the inferrer for columns without a type affinity (flash-gordon)
551
+ - Support for composite PKs in the default `by_pk` view (solnic)
447
552
 
448
553
  ### Changed
449
554
 
450
- * [BREAKING] `Relation#header` has been removed in favor of schemas (solnic)
451
- * [BREAKING] `Relation#base` has been removed as now a vanilla relation *is a base relation view* (solnic)
452
- * [BREAKING] Deprecated `Relation.primary_key` has been removed in favor of schema (solnic)
453
- * [BREAKING] Deprecated `Commands::Update#change` has been removed (solnic)
454
- * [BREAKING] Deprecated `Commands.validator` has been removed (solnic)
455
- * [BREAKING] `assoc_macros` plugin has been removed, please use associations from now (solnic)
456
- * Default `by_pk` uses schema attributes, it will raise exception if PK attribute is missing in the schema (solnic)
457
- * [internal] Associations use schemas for relation projections (solnic)
458
- * [internal] `select`, `select_append`, `project`, `inner_join` and `left_join` use schemas internally (solnic)
459
- * [internal] Deprecation and constants are now based on dry-core (flash-gordon)
555
+ - [BREAKING] `Relation#header` has been removed in favor of schemas (solnic)
556
+ - [BREAKING] `Relation#base` has been removed as now a vanilla relation _is a base relation view_ (solnic)
557
+ - [BREAKING] Deprecated `Relation.primary_key` has been removed in favor of schema (solnic)
558
+ - [BREAKING] Deprecated `Commands::Update#change` has been removed (solnic)
559
+ - [BREAKING] Deprecated `Commands.validator` has been removed (solnic)
560
+ - [BREAKING] `assoc_macros` plugin has been removed, please use associations from now (solnic)
561
+ - Default `by_pk` uses schema attributes, it will raise exception if PK attribute is missing in the schema (solnic)
562
+ - [internal] Associations use schemas for relation projections (solnic)
563
+ - [internal] `select`, `select_append`, `project`, `inner_join` and `left_join` use schemas internally (solnic)
564
+ - [internal] Deprecation and constants are now based on dry-core (flash-gordon)
460
565
 
461
566
  [Compare v0.9.1...v1.0.0](https://github.com/rom-rb/rom-sql/compare/v0.9.1...v1.0.0)
462
567
 
463
- ## v0.9.1 2016-12-23
568
+ ## 0.9.1 2016-12-23
569
+
464
570
 
465
571
  ### Added
466
572
 
467
- * Support for PG enums in schema inferrer (flash-gordon)
468
- * `ROM::SQL::Relation#read` method which accepts an SQL string and returns a new relation (solnic)
573
+ - Support for PG enums in schema inferrer (flash-gordon)
574
+ - `ROM::SQL::Relation#read` method which accepts an SQL string and returns a new relation (solnic)
575
+
469
576
 
470
577
  [Compare v0.9.0...v0.9.1](https://github.com/rom-rb/rom-sql/compare/v0.9.0...v0.9.1)
471
578
 
472
- ## v0.9.0 2016-11-08
579
+ ## 0.9.0 2016-11-08
580
+
473
581
 
474
582
  ### Added
475
583
 
476
- * `Associations::{OneToMany,OneToOne}#associate` for merging FKs into child tuple (jodosha)
477
- * Added support for PostgreSQL types: UUID, Array, JSONB and Money (jodosha)
478
- * Support for DB specific schema inferrers (flash-gordon)
479
- * Automatically infer PG arrays and JSON(B) types (jodosha + flash-gordon)
480
- * Support for `Relation#having` (cflipse)
584
+ - `Associations::{OneToMany,OneToOne}#associate` for merging FKs into child tuple (jodosha)
585
+ - Added support for PostgreSQL types: UUID, Array, JSONB and Money (jodosha)
586
+ - Support for DB specific schema inferrers (flash-gordon)
587
+ - Automatically infer PG arrays and JSON(B) types (jodosha + flash-gordon)
588
+ - Support for `Relation#having` (cflipse)
481
589
 
482
- ### Changed
590
+ ### Fixed
483
591
 
484
- * Inferred types in schemas **are no longer strict** (flash-gordon)
485
- * PG-specific types are handled by `:postgres` extension and it loads connection extensions automatically (flash-gordon)
486
- * Make `OneToOne` inherit from `OneToMany` (beauby)
487
- * Default dataset will use column names from schema if it's available (solnic)
592
+ - Floats are inferred by schemas (cflipse)
488
593
 
489
- ### Fixed
594
+ ### Changed
490
595
 
491
- * Floats are inferred by schemas (cflipse)
596
+ - Inferred types in schemas **are no longer strict** (flash-gordon)
597
+ - PG-specific types are handled by `:postgres` extension and it loads connection extensions automatically (flash-gordon)
598
+ - Make `OneToOne` inherit from `OneToMany` (beauby)
599
+ - Default dataset will use column names from schema if it's available (solnic)
492
600
 
493
601
  [Compare v0.8.0...v0.9.0](https://github.com/rom-rb/rom-sql/compare/v0.8.0...v0.9.0)
494
602
 
495
- ## v0.8.0 2016-07-27
603
+ ## 0.8.0 2016-07-27
604
+
496
605
 
497
606
  ### Added
498
607
 
499
- * Support for relation schemas with SQL-specific data types (solnic + flash-gordon)
500
- * One-To-Many support in schemas (solnic + flash-gordon)
501
- * One-To-One support in schemas (solnic + flash-gordon)
502
- * One-To-One-Through support in schemas (solnic + flash-gordon)
503
- * Many-To-One support in schemas (solnic + flash-gordon)
504
- * Many-To-Many support in schemas (solnic + flash-gordon)
505
- * Support for `has_many`, `has_one` and `belongs_to` convenient methods in schema DSL (solnic)
506
- * Support for custom PG types: `Types::PG::Array`, `Types::PG::Hash`, `Types::PG::JSON`, and `Types::PG::Bytea` (solnic + flash-gordon)
507
- * Optional automatic schema inference for attributes and foreign keys based on DB metadata provided by Sequel (flash-gordon)
508
- * Support for arbitrary dataset and FK names in schemas (flash-gordon)
509
- * Support for native upserts in PostgreSQL >= 9.5 via `Commands::Postgres::Upsert` (gotar + flash-gordon)
608
+ - Support for relation schemas with SQL-specific data types (solnic + flash-gordon)
609
+ - One-To-Many support in schemas (solnic + flash-gordon)
610
+ - One-To-One support in schemas (solnic + flash-gordon)
611
+ - One-To-One-Through support in schemas (solnic + flash-gordon)
612
+ - Many-To-One support in schemas (solnic + flash-gordon)
613
+ - Many-To-Many support in schemas (solnic + flash-gordon)
614
+ - Support for `has_many`, `has_one` and `belongs_to` convenient methods in schema DSL (solnic)
615
+ - Support for custom PG types: `Types::PG::Array`, `Types::PG::Hash`, `Types::PG::JSON`, and `Types::PG::Bytea` (solnic + flash-gordon)
616
+ - Optional automatic schema inference for attributes and foreign keys based on DB metadata provided by Sequel (flash-gordon)
617
+ - Support for arbitrary dataset and FK names in schemas (flash-gordon)
618
+ - Support for native upserts in PostgreSQL >= 9.5 via `Commands::Postgres::Upsert` (gotar + flash-gordon)
510
619
 
511
- ### Changed
620
+ ### Fixed
512
621
 
513
- * `Create` and `Update` commands have `:schema` plugin enabled by default which sets input handler based on schema definition automatically (solnic)
514
- * `associates` command plugin uses schema associations now (solnic)
515
- * Dropped MRI 2.0.x support
622
+ - `Create` command properly materialize result when `:one` is set (AMHOL)
516
623
 
517
- ### Fixed
624
+ ### Changed
518
625
 
519
- * `Create` command properly materialize result when `:one` is set (AMHOL)
626
+ - `Create` and `Update` commands have `:schema` plugin enabled by default which sets input handler based on schema definition automatically (solnic)
627
+ - `associates` command plugin uses schema associations now (solnic)
628
+ - Dropped MRI 2.0.x support
520
629
 
521
630
  [Compare v0.7.0...v0.8.0](https://github.com/rom-rb/rom-sql/compare/v0.7.0...v0.8.0)
522
631
 
523
- ## v0.7.0 2016-01-06
632
+ ## 0.7.0 2016-01-06
633
+
524
634
 
525
635
  ### Added
526
636
 
527
- * Repository plugins have been imported:
528
- * `view` allows defining a relation view with an explicit header (solnic)
529
- * `base_view` defines a base view with all column names as the header (solnic)
530
- * `auto_combine` defines a generic `for_combine` method which eager-loads
637
+ - Repository plugins have been imported:
638
+ - `view` allows defining a relation view with an explicit header (solnic)
639
+ - `base_view` defines a base view with all column names as the header (solnic)
640
+ - `auto_combine` defines a generic `for_combine` method which eager-loads
531
641
  parent/children relation (solnic)
532
- * `auto-wrap` defines a generic `for_wrap` method which inner-joins
642
+ - `auto-wrap` defines a generic `for_wrap` method which inner-joins
533
643
  a parent/children relation (solnic)
534
- * Possibility to check for pending migrations (gotar)
535
- * `Relation#sum` interface (gotar)
536
- * `Relation#avg` interface (gotar)
537
- * `Relation#min` interface (gotar)
538
- * `Relation#max` interface (gotar)
539
- * `Relation#union` interface (spscream)
540
- * `primary_key` macro which allows setting a custom primary key when it cannot be
541
- inferred automatically (solnic)
644
+ - Possibility to check for pending migrations (gotar)
645
+ - `Relation#sum` interface (gotar)
646
+ - `Relation#avg` interface (gotar)
647
+ - `Relation#min` interface (gotar)
648
+ - `Relation#max` interface (gotar)
649
+ - `Relation#union` interface (spscream)
650
+ - `primary_key` macro which allows setting a custom primary key when it cannot be
651
+ inferred automatically (solnic)
542
652
 
543
653
  ### Changed
544
654
 
545
- * `ROM::SQL.gateway` renamed to `ROM::SQL::Gateway.instance` for migrations (endash)
546
- * Association macros are now an optional plugin (solnic)
655
+ - `ROM::SQL.gateway` renamed to `ROM::SQL::Gateway.instance` for migrations (endash)
656
+ - Association macros are now an optional plugin (solnic)
547
657
 
548
658
  [Compare v0.6.1...v0.7.0](https://github.com/rom-rb/rom-sql/compare/v0.6.1...v0.7.0)
549
659
 
550
- ## v0.6.1 2015-09-23
660
+ ## 0.6.1 2015-09-23
661
+
551
662
 
552
663
  ### Added
553
664
 
554
- * `Gateway` accepts `:extensions` as an option (c0)
665
+ - `Gateway` accepts `:extensions` as an option (c0)
666
+
555
667
 
556
668
  [Compare v0.6.0...v0.6.1](https://github.com/rom-rb/rom-sql/compare/v0.6.0...v0.6.1)
557
669
 
558
- ## v0.6.0 2015-08-19
670
+ ## 0.6.0 2015-08-19
559
671
 
560
672
  Internal updates to fix deprecation warnings from ROM 0.9.0.
561
673
 
674
+
562
675
  [Compare v0.5.3...v0.6.0](https://github.com/rom-rb/rom-sql/compare/v0.5.3...v0.6.0)
563
676
 
564
- ## v0.5.3 2015-07-23
677
+ ## 0.5.3 2015-07-23
678
+
565
679
 
566
680
  ### Added
567
681
 
568
- * `Relation#multi_insert` (draxxxeus)
682
+ - `Relation#multi_insert` (draxxxeus)
569
683
 
570
- ### Changed
684
+ ### Fixed
571
685
 
572
- * Command that receives many tuples will use `multi_insert` now (draxxxeus)
686
+ - Relation name and join key fixes for `many_to_one` macro (jamesmoriarty)
573
687
 
574
- ### Fixed
688
+ ### Changed
575
689
 
576
- * Relation name and join key fixes for `many_to_one` macro (jamesmoriarty)
690
+ - Command that receives many tuples will use `multi_insert` now (draxxxeus)
577
691
 
578
692
  [Compare v0.5.2...v0.5.3](https://github.com/rom-rb/rom-sql/compare/v0.5.2...v0.5.3)
579
693
 
580
- ## v0.5.2 2015-06-22
694
+ ## 0.5.2 2015-06-22
695
+
581
696
 
582
697
  ### Added
583
698
 
584
- * `Relation#invert` operation (nepalez)
699
+ - `Relation#invert` operation (nepalez)
585
700
 
586
701
  ### Changed
587
702
 
588
- * Migration tasks no longer require entire ROM env (solnic)
589
- * `Repository` => `Gateway` rename for ROM 0.8.0 compatibility (solnic)
703
+ - Migration tasks no longer require entire ROM env (solnic)
704
+ - `Repository` => `Gateway` rename for ROM 0.8.0 compatibility (solnic)
590
705
 
591
706
  [Compare v0.5.1...v0.5.2](https://github.com/rom-rb/rom-sql/compare/v0.5.1...v0.5.2)
592
707
 
593
- ## v0.5.1 2015-05-25
708
+ ## 0.5.1 2015-05-25
594
709
 
595
- ### Changed
596
-
597
- * Relations won't be finalized when table(s) is/are missing (solnic)
598
710
 
599
711
  ### Fixed
600
712
 
601
- * Wrap errors when calling commands with `[]`-syntax (kwando)
713
+ - Wrap errors when calling commands with `[]`-syntax (kwando)
714
+
715
+ ### Changed
716
+
717
+ - Relations won't be finalized when table(s) is/are missing (solnic)
602
718
 
603
719
  [Compare v0.5.0...v0.5.1](https://github.com/rom-rb/rom-sql/compare/v0.5.0...v0.5.1)
604
720
 
605
- ## v0.5.0 2015-05-22
721
+ ## 0.5.0 2015-05-22
722
+
606
723
 
607
724
  ### Added
608
725
 
609
- * Association macros support addition `:on` option (solnic)
610
- * `associates` plugin for `Create` command (solnic)
611
- * Support for NotNullConstraintError (solnic)
612
- * Support for UniqueConstraintConstraintError (solnic)
613
- * Support for ForeignKeyConstraintError (solnic)
614
- * Support for CheckConstraintError (solnic)
615
- * `Commands::Update#original` supports objects coercible to_h now (solnic)
726
+ - Association macros support addition `:on` option (solnic)
727
+ - `associates` plugin for `Create` command (solnic)
728
+ - Support for NotNullConstraintError (solnic)
729
+ - Support for UniqueConstraintConstraintError (solnic)
730
+ - Support for ForeignKeyConstraintError (solnic)
731
+ - Support for CheckConstraintError (solnic)
732
+ - `Commands::Update#original` supports objects coercible to_h now (solnic)
616
733
 
617
734
  ### Changed
618
735
 
619
- * [BREAKING] Constraint errors are no longer command errors which means `try` and
736
+ - [BREAKING] Constraint errors are no longer command errors which means `try` and
620
737
  `transaction` blocks will not catch them (solnic)
621
- * `Commands::Update#set` has been deprecated (solnic)
622
- * `Commands::Update#to` has been deprecated (solnic)
738
+ - `Commands::Update#set` has been deprecated (solnic)
739
+ - `Commands::Update#to` has been deprecated (solnic)
740
+
741
+ [Compare v0.4.3...v0.5.0](https://github.com/rom-rb/rom-sql/compare/v0.4.3...v0.5.0)
623
742
 
624
- [Compare v0.4.3...v0.5.0](https://github.com/rom-rb/rom-sql/compare/v0.4.2...v0.5.0)
743
+ ## 0.4.3 2015-05-17
625
744
 
626
- ## v0.4.3 2015-05-17
627
745
 
628
746
  ### Fixed
629
747
 
630
- * `transaction` doesn't swallow errors now other than CommandError (solnic)
748
+ - `transaction` doesn't swallow errors now other than CommandError (solnic)
749
+
631
750
 
632
751
  [Compare v0.4.2...v0.4.3](https://github.com/rom-rb/rom-sql/compare/v0.4.2...v0.4.3)
633
752
 
634
- ## v0.4.2 2015-05-17
753
+ ## 0.4.2 2015-05-17
754
+
635
755
 
636
756
  ### Added
637
757
 
638
- * Support for setting custom association name (solnic)
639
- * Support for `:conditions` option in association definition (solnic)
640
- * Better error message when accessing undefined associations (pdswan)
758
+ - Support for setting custom association name (solnic)
759
+ - Support for `:conditions` option in association definition (solnic)
760
+ - Better error message when accessing undefined associations (pdswan)
641
761
 
642
762
  ### Fixed
643
763
 
644
- * Correct `ROM::SQL::Plugin::Pagination::Pager#total_pages` when total is not
764
+ - Correct `ROM::SQL::Plugin::Pagination::Pager#total_pages` when total is not
645
765
  evenly divisible by page size (larribas)
646
- * `association_join` behaves correctly when dataset is different than register_as (nepalez)
766
+ - `association_join` behaves correctly when dataset is different than register_as (nepalez)
647
767
 
648
768
  ### Changed
649
769
 
650
- * `transaction` returns command failure objects when there was a rollback (solnic)
770
+ - `transaction` returns command failure objects when there was a rollback (solnic)
651
771
 
652
772
  [Compare v0.4.1...v0.4.2](https://github.com/rom-rb/rom-sql/compare/v0.4.1...v0.4.2)
653
773
 
654
- ## v0.4.1 2015-04-04
774
+ ## 0.4.1 2015-04-04
775
+
655
776
 
656
777
  ### Added
657
778
 
658
- * Database error handling for update and delete commands (kwando + solnic)
659
- * Migration interface as a repository plugin (gotar + solnic)
779
+ - Database error handling for update and delete commands (kwando + solnic)
780
+ - Migration interface as a repository plugin (gotar + solnic)
781
+
660
782
 
661
783
  [Compare v0.4.0...v0.4.1](https://github.com/rom-rb/rom-sql/compare/v0.4.0...v0.4.1)
662
784
 
663
- ## v0.4.0 2015-03-22
785
+ ## 0.4.0 2015-03-22
786
+
664
787
 
665
788
  ### Added
666
789
 
667
- * `ROM::SQL::Relation` which explictly defines an interface on top of Sequel (solnic + mcls)
668
- * Postgres-specific Create and Update commands that support RETURNING (gotar + solnic)
669
- * `Update#change` interface for skipping execution when there's no diff (solnic)
670
- * Experimental migration API using sequel/migrations (gotar)
671
- * Pagination plugin (solnic)
672
- * Allow reuse of established Sequel connections (splattael)
790
+ - `ROM::SQL::Relation` which explictly defines an interface on top of Sequel (solnic + mcls)
791
+ - Postgres-specific Create and Update commands that support RETURNING (gotar + solnic)
792
+ - `Update#change` interface for skipping execution when there's no diff (solnic)
793
+ - Experimental migration API using sequel/migrations (gotar)
794
+ - Pagination plugin (solnic)
795
+ - Allow reuse of established Sequel connections (splattael)
673
796
 
674
- ### Changed
797
+ ### Fixed
675
798
 
676
- * Use ROM's own inflector which uses either ActiveSupport or Inflecto backends (mjtko)
799
+ - Indentation in Rails logger (morgoth)
677
800
 
678
- ### Fixed
801
+ ### Changed
679
802
 
680
- * Indentation in Rails logger (morgoth)
803
+ - Use ROM's own inflector which uses either ActiveSupport or Inflecto backends (mjtko)
681
804
 
682
805
  [Compare v0.3.2...v0.4.0](https://github.com/rom-rb/rom-sql/compare/v0.3.2...v0.4.0)
683
806
 
684
- ## v0.3.2 2015-01-01
807
+ ## 0.3.2 2015-01-01
808
+
685
809
 
686
810
  ### Fixed
687
811
 
688
- * Checking tuple count in commands (solnic)
812
+ - Checking tuple count in commands (solnic)
813
+
689
814
 
690
815
  [Compare v0.3.1...v0.3.2](https://github.com/rom-rb/rom-sql/compare/v0.3.1...v0.3.2)
691
816
 
692
- ## v0.3.1 2014-12-31
817
+ ## 0.3.1 2014-12-31
818
+
693
819
 
694
820
  ### Added
695
821
 
696
- * `Adapter#disconnect` (solnic)
697
- * Support for extra connection options (solnic)
822
+ - `Adapter#disconnect` (solnic)
823
+ - Support for extra connection options (solnic)
824
+
698
825
 
699
826
  [Compare v0.3.0...v0.3.1](https://github.com/rom-rb/rom-sql/compare/v0.3.0...v0.3.1)
700
827
 
701
- ## v0.3.0 2014-12-19
828
+ ## 0.3.0 2014-12-19
829
+
702
830
 
703
831
  ### Changed
704
832
 
705
- * `association_join` now uses Sequel's `graph` interface which qualifies columns automatically (solnic)
706
- * Delete command returns deleted tuples (solnic)
833
+ - `association_join` now uses Sequel's `graph` interface which qualifies columns automatically (solnic)
834
+ - Delete command returns deleted tuples (solnic)
707
835
 
708
836
  [Compare v0.2.0...v0.3.0](https://github.com/rom-rb/rom-sql/compare/v0.2.0...v0.3.0)
709
837
 
710
- ## v0.2.0 2014-12-06
838
+ ## 0.2.0 2014-12-06
839
+
711
840
 
712
841
  ### Added
713
842
 
714
- * Command API (solnic)
715
- * Support for ActiveSupport::Notifications with a log subscriber (solnic)
716
- * New `ROM::SQL::Adapter#dataset?(name)` checking if a given table exists (solnic)
843
+ - Command API (solnic)
844
+ - Support for ActiveSupport::Notifications with a log subscriber (solnic)
845
+ - New `ROM::SQL::Adapter#dataset?(name)` checking if a given table exists (solnic)
846
+
717
847
 
718
848
  [Compare v0.1.1...v0.2.0](https://github.com/rom-rb/rom-sql/compare/v0.1.1...v0.2.0)
719
849
 
720
- ## v0.1.1 2014-11-24
850
+ ## 0.1.1 2014-11-24
851
+
721
852
 
722
853
  ### Fixed
723
854
 
724
- * Equalizer in header (solnic)
855
+ - Equalizer in header (solnic)
725
856
 
726
857
  ### Changed
727
858
 
728
- * minor refactor in adapter (solnic)
859
+ - minor refactor in adapter (solnic)
729
860
 
730
861
  [Compare v0.1.0...v0.1.1](https://github.com/rom-rb/rom-sql/compare/v0.1.0...v0.1.1)
731
862
 
732
- ## v0.1.0 2014-11-24
863
+ ## 0.1.0 2014-11-24
733
864
 
734
865
  First release powered by Sequel