rom-sql 2.5.0 → 3.3.0

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