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