rom-core 4.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +603 -0
  3. data/LICENSE +20 -0
  4. data/README.md +18 -0
  5. data/lib/rom-core.rb +1 -0
  6. data/lib/rom/array_dataset.rb +44 -0
  7. data/lib/rom/association_set.rb +16 -0
  8. data/lib/rom/associations/abstract.rb +135 -0
  9. data/lib/rom/associations/definitions.rb +5 -0
  10. data/lib/rom/associations/definitions/abstract.rb +116 -0
  11. data/lib/rom/associations/definitions/many_to_many.rb +24 -0
  12. data/lib/rom/associations/definitions/many_to_one.rb +11 -0
  13. data/lib/rom/associations/definitions/one_to_many.rb +11 -0
  14. data/lib/rom/associations/definitions/one_to_one.rb +11 -0
  15. data/lib/rom/associations/definitions/one_to_one_through.rb +11 -0
  16. data/lib/rom/associations/many_to_many.rb +81 -0
  17. data/lib/rom/associations/many_to_one.rb +37 -0
  18. data/lib/rom/associations/one_to_many.rb +37 -0
  19. data/lib/rom/associations/one_to_one.rb +8 -0
  20. data/lib/rom/associations/one_to_one_through.rb +8 -0
  21. data/lib/rom/associations/through_identifier.rb +39 -0
  22. data/lib/rom/auto_curry.rb +55 -0
  23. data/lib/rom/cache.rb +46 -0
  24. data/lib/rom/command.rb +488 -0
  25. data/lib/rom/command_compiler.rb +239 -0
  26. data/lib/rom/command_proxy.rb +24 -0
  27. data/lib/rom/command_registry.rb +141 -0
  28. data/lib/rom/commands.rb +3 -0
  29. data/lib/rom/commands/class_interface.rb +270 -0
  30. data/lib/rom/commands/composite.rb +53 -0
  31. data/lib/rom/commands/create.rb +13 -0
  32. data/lib/rom/commands/delete.rb +14 -0
  33. data/lib/rom/commands/graph.rb +88 -0
  34. data/lib/rom/commands/graph/class_interface.rb +62 -0
  35. data/lib/rom/commands/graph/input_evaluator.rb +62 -0
  36. data/lib/rom/commands/lazy.rb +99 -0
  37. data/lib/rom/commands/lazy/create.rb +23 -0
  38. data/lib/rom/commands/lazy/delete.rb +27 -0
  39. data/lib/rom/commands/lazy/update.rb +34 -0
  40. data/lib/rom/commands/result.rb +96 -0
  41. data/lib/rom/commands/update.rb +14 -0
  42. data/lib/rom/configuration.rb +114 -0
  43. data/lib/rom/configuration_dsl.rb +87 -0
  44. data/lib/rom/configuration_dsl/command.rb +41 -0
  45. data/lib/rom/configuration_dsl/command_dsl.rb +35 -0
  46. data/lib/rom/configuration_dsl/relation.rb +26 -0
  47. data/lib/rom/configuration_plugin.rb +17 -0
  48. data/lib/rom/constants.rb +64 -0
  49. data/lib/rom/container.rb +147 -0
  50. data/lib/rom/core.rb +46 -0
  51. data/lib/rom/create_container.rb +60 -0
  52. data/lib/rom/data_proxy.rb +94 -0
  53. data/lib/rom/enumerable_dataset.rb +68 -0
  54. data/lib/rom/environment.rb +70 -0
  55. data/lib/rom/gateway.rb +184 -0
  56. data/lib/rom/global.rb +58 -0
  57. data/lib/rom/global/plugin_dsl.rb +47 -0
  58. data/lib/rom/initializer.rb +64 -0
  59. data/lib/rom/lint/enumerable_dataset.rb +54 -0
  60. data/lib/rom/lint/gateway.rb +120 -0
  61. data/lib/rom/lint/linter.rb +78 -0
  62. data/lib/rom/lint/spec.rb +20 -0
  63. data/lib/rom/lint/test.rb +98 -0
  64. data/lib/rom/mapper_registry.rb +24 -0
  65. data/lib/rom/memory.rb +4 -0
  66. data/lib/rom/memory/associations.rb +4 -0
  67. data/lib/rom/memory/associations/many_to_many.rb +10 -0
  68. data/lib/rom/memory/associations/many_to_one.rb +10 -0
  69. data/lib/rom/memory/associations/one_to_many.rb +10 -0
  70. data/lib/rom/memory/associations/one_to_one.rb +10 -0
  71. data/lib/rom/memory/commands.rb +56 -0
  72. data/lib/rom/memory/dataset.rb +97 -0
  73. data/lib/rom/memory/gateway.rb +64 -0
  74. data/lib/rom/memory/relation.rb +62 -0
  75. data/lib/rom/memory/schema.rb +23 -0
  76. data/lib/rom/memory/storage.rb +59 -0
  77. data/lib/rom/memory/types.rb +9 -0
  78. data/lib/rom/pipeline.rb +105 -0
  79. data/lib/rom/plugin.rb +25 -0
  80. data/lib/rom/plugin_base.rb +45 -0
  81. data/lib/rom/plugin_registry.rb +197 -0
  82. data/lib/rom/plugins/command/schema.rb +37 -0
  83. data/lib/rom/plugins/configuration/configuration_dsl.rb +21 -0
  84. data/lib/rom/plugins/relation/instrumentation.rb +51 -0
  85. data/lib/rom/plugins/relation/registry_reader.rb +44 -0
  86. data/lib/rom/plugins/schema/timestamps.rb +58 -0
  87. data/lib/rom/registry.rb +71 -0
  88. data/lib/rom/relation.rb +548 -0
  89. data/lib/rom/relation/class_interface.rb +282 -0
  90. data/lib/rom/relation/commands.rb +23 -0
  91. data/lib/rom/relation/composite.rb +46 -0
  92. data/lib/rom/relation/curried.rb +103 -0
  93. data/lib/rom/relation/graph.rb +197 -0
  94. data/lib/rom/relation/loaded.rb +127 -0
  95. data/lib/rom/relation/materializable.rb +66 -0
  96. data/lib/rom/relation/name.rb +111 -0
  97. data/lib/rom/relation/view_dsl.rb +64 -0
  98. data/lib/rom/relation/wrap.rb +83 -0
  99. data/lib/rom/relation_registry.rb +10 -0
  100. data/lib/rom/schema.rb +437 -0
  101. data/lib/rom/schema/associations_dsl.rb +195 -0
  102. data/lib/rom/schema/attribute.rb +419 -0
  103. data/lib/rom/schema/dsl.rb +164 -0
  104. data/lib/rom/schema/inferrer.rb +66 -0
  105. data/lib/rom/schema_plugin.rb +27 -0
  106. data/lib/rom/setup.rb +68 -0
  107. data/lib/rom/setup/auto_registration.rb +74 -0
  108. data/lib/rom/setup/auto_registration_strategies/base.rb +16 -0
  109. data/lib/rom/setup/auto_registration_strategies/custom_namespace.rb +63 -0
  110. data/lib/rom/setup/auto_registration_strategies/no_namespace.rb +20 -0
  111. data/lib/rom/setup/auto_registration_strategies/with_namespace.rb +18 -0
  112. data/lib/rom/setup/finalize.rb +103 -0
  113. data/lib/rom/setup/finalize/finalize_commands.rb +60 -0
  114. data/lib/rom/setup/finalize/finalize_mappers.rb +56 -0
  115. data/lib/rom/setup/finalize/finalize_relations.rb +135 -0
  116. data/lib/rom/support/configurable.rb +85 -0
  117. data/lib/rom/support/memoizable.rb +58 -0
  118. data/lib/rom/support/notifications.rb +103 -0
  119. data/lib/rom/transaction.rb +24 -0
  120. data/lib/rom/types.rb +26 -0
  121. data/lib/rom/version.rb +5 -0
  122. metadata +289 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef15d608c1f83a62e5fda73922905f3ea6b4ac64
4
+ data.tar.gz: 0756e26ace05072f5717d47f7738e21a43e322c7
5
+ SHA512:
6
+ metadata.gz: 46aecaac6f9e294a7acbadd9dcd5b5c56a2b08a4bd62e15b6d408089b1ab130149a7f9d02000d78b83ed41947d0e04648be6ae30c6591428db59e3b84615d2c1
7
+ data.tar.gz: 8f6c5783b58df407395d2c25e1b3389c4b011d49922a9c73cd2f8e613c7464ce5122a03ddccc4311844e28adeac37e5893fcbc893277cb93805cdecd47a71aa3
data/CHANGELOG.md ADDED
@@ -0,0 +1,603 @@
1
+ # v4.0.0 to-be-released
2
+
3
+ Previous `rom` gem was renamed to `rom-core`
4
+
5
+ ## Added
6
+
7
+ * Relations can be configured with `auto_map true` which brings auto-mapping functionality known from rom-repository (solnic)
8
+ * Relations can be configured with `auto_struct true` which brings auto-struct functionality known from rom-repository (solnic)
9
+ * `Relation#map_to(model)` which replaced `as` (solnic)
10
+ * `Relation#wrap` is now part of core API and requires associations to be configured (solnic)
11
+ * `Relation#combine` automatically returns a relation graph based on configured associations (solnic)
12
+ * `Relation#command` which automatically creates a command for a given relation, supports graphs too (solnic)
13
+ * `Relation::to_ast` which returns an AST representation of a relation. This can be used to infer other objects based on relation information (solnic)
14
+ * `Relation::Name#as` which returns an aliased relation name (solnic)
15
+ * Association DSL supports `:override` option which will use configured `:view` as the relation used by association (solnic)
16
+ * Associations are now part of core API and available to all adapters, cross-adapter associations are supported too via `:override` option (solnic)
17
+ * `Schema#primary_key_name` and `Schema#primary_key_names` are now part of core schema API (solnic)
18
+ * `Schema#to_ast` which returns an AST representation of a relation schema (flash-gordon)
19
+ * Plugin system supports schema plugins (flash-gordon)
20
+ * Setup and finalization is now based on events, which you can subscribe to. This allows plugin and adapter developers to hook into components in a simple and stable way (solnic)
21
+
22
+ ## Changed
23
+
24
+ * Works with MRI >= 2.2
25
+ * [BREAKING] Inferring relations from database schema **has been removed**. You need to define relations explicitly now (solnic)
26
+ * [BREAKING] Relations have `auto_map` **turned on by default**. This means that wraps and graphs return nested data structures automatically (solnic)
27
+ * [BREAKING] `Relation#combine` behavior from previous versions is now provided by `Relation#graph` (solnic)
28
+ * [BREAKING] `Relation#as` now returns a new relation with aliased name, use `Relation#map_with(*list-of-mapper-ids)` or `Relation#map_to(model)` if you just want to map to custom models (solnic)
29
+ * [BREAKING] `Relation.register_as(:bar)` is removed in favor of `schema(:foo, as: :bar)` (solnic)
30
+ * [BREAKING] `Relation.dataset(:foo)` is removed in favor of `schema(:foo)`. Passing a block still works like before (solnic)
31
+ * Separation between relations that are standalone or registrable in a registry is gone. All relations have names and schemas now.
32
+ They are automatically set to defaults. In practice this means you can instantiate a relation object manually and it'll Just Work (solnic)
33
+ * Mapper and command objects are cached locally within a given rom container (solnic)
34
+
35
+ ## Internal
36
+
37
+ * [BREAKING] `Relation::Curried#name` was renamed to `Relation::Curried#view` (solnic)
38
+ * [BREAKING] `Association::Name` was removed in favor of using `Relation::Name` (solnic)
39
+ * Relations no longer use `method_missing` for accessing other relations from the registry (solnic)
40
+
41
+ ## Fixed
42
+
43
+ * Inferred struct attributes use simplified types. This fixed a problem when read types from relation schemas would be applied twice (flash-gordon)
44
+ * Trying to register a mapper with the same identifier more than once will raise an error (GustavoCaso)
45
+
46
+ # v3.2.2 2017-05-05
47
+
48
+ ## Changed
49
+
50
+ * [internal] Compatibility with `dry-core` v0.3.0 (flash-gordon)
51
+
52
+ [Compare v3.2.1...v3.2.2](https://github.com/rom-rb/rom/compare/v3.2.1...v3.2.2)
53
+
54
+ # v3.2.1 2017-05-02
55
+
56
+ ## Changed
57
+
58
+ * [internal] `ROM::Schema::Attribute` uses `Initializer` now (flash-gordon)
59
+
60
+ [Compare v3.2.0...v3.2.1](https://github.com/rom-rb/rom/compare/v3.2.0...v3.2.1)
61
+
62
+ # v3.2.0 2017-03-25
63
+
64
+ ## Changed
65
+
66
+ * `dry-initializer` was updated to `1.3`, this is a minor change, but leads to some incompatibilities with existing adapters, hence `3.2.0` shall be released (flash-gordon)
67
+
68
+ [Compare v3.1.0...v3.2.0](https://github.com/rom-rb/rom/compare/v3.1.0...v3.2.0)
69
+
70
+ # v3.1.0 2017-03-01
71
+
72
+ ## Added
73
+
74
+ * New configuration DSL for configuring plugins (solnic)
75
+ * Instrumentation plugin for relations (solnic)
76
+ * New `ROM::Relation::Loaded#empty?` method (solnic)
77
+ * New `ROM::Relation::Graph#with_nodes` which returns a new graph with new nodes (solnic)
78
+ * New `ROM::Schema#empty` which returns an empty schema (solnic)
79
+
80
+ [Compare v3.0.3...v3.1.0](https://github.com/rom-rb/rom/compare/v3.0.3...v3.1.0)
81
+
82
+ # v3.0.3 2017-02-24
83
+
84
+ ## Fixed
85
+
86
+ * Curried relations when called without args while having some args filled in will return itself (solnic)
87
+
88
+ [Compare v3.0.2...v3.0.3](https://github.com/rom-rb/rom/compare/v3.0.2...v3.0.3)
89
+
90
+ # v3.0.2 2017-02-24
91
+
92
+ ## Added
93
+
94
+ * `Schema::Attribute#key` which returns tuple key name, either alias or canonical name (solnic)
95
+
96
+ ## Fixed
97
+
98
+ * Fix output_schema to use Attribute#key rather than canonical names (solnic)
99
+ * Fix the error message for missing association (flash-gordon)
100
+ * Curried relation called without any arguments will raise an ArgumentError (solnic)
101
+
102
+ [Compare v3.0.1...v3.0.2](https://github.com/rom-rb/rom/compare/v3.0.1...v3.0.2)
103
+
104
+ # v3.0.1 2017-02-01
105
+
106
+ ## Fixed
107
+
108
+ * ViewDSL exposes schemas that have access to all relations (solnic)
109
+
110
+ [Compare v3.0.0...v3.0.1](https://github.com/rom-rb/rom/compare/v3.0.0...v3.0.1)
111
+
112
+ # v3.0.0 2017-01-29
113
+
114
+ ## Added
115
+
116
+ * Support for schemas in view definitions via `schema do ... end` block (evaluated in the context of the canonical schema) (solnic)
117
+ * Schemas have their own types with adapter-specific APIs (solnic)
118
+ * Schema attributes include meta properties `source` and `target` (for FKs) (solnic)
119
+ * Inferred schemas can have explicit attribute definitions for cases where inference didn't work (solnic)
120
+ * New schema APIs: `#project`, `#rename`, `#exclude`, `#prefix`, `#wrap`, `#merge`, `#append` and `#uniq` (solnic)
121
+ * New schema attribute APIs: `#name`, `#aliased`, `#aliased?`, `#prefixed`, `#prefixed?`, `#wrapped`, `#wrapped?`, `#source`, `#target`, `#primary_key?`, `#foreign_key?` (solnic)
122
+ * Schemas are coercible to arrays that include all attribute types (solnic)
123
+ * Automatic relation view projection via `Schema#call` (abstract method for adapters) (solnic)
124
+ * `Relation#new(dataset, new_opts)` interface (solnic)
125
+ * `Relation#[]` interface for convenient access to schema attributes (solnic)
126
+ * `Command` has now support for `before` and `after` hooks (solnic)
127
+ * Support for `read` types in schemas, these are used when relation loads its tuples (solnic)
128
+ * New `Command#before` method for creating a command with before hook(s) at run-time (solnic)
129
+ * New `Command#after` method for creating a command with after hook(s) at run-time (solnic)
130
+ * New `Gateway#transaction` method runs code inside a transaction (flash-gordon)
131
+
132
+ ## Changed
133
+
134
+ * [BREAKING] All relations have schemas now, empty by default (solnic)
135
+ * [BREAKING] `view` DSL is now part of the core relation API (solnic)
136
+ * [BREAKING] `view` DSL is based on schemas now, `header` was replaced with `schema` (solnic)
137
+ * [BREAKING] Deprecated `Command.validator` was removed (solnic)
138
+ * [internal] Renamed `relation` => `target` meta property in FK types (solnic)
139
+ * [internal] Use deprecations API from dry-core (flash-gordon)
140
+ * [internal] Use common constants from dry-core (EMPTY_HASH, EMPTY_ARRAY etc.) (flash-gordon)
141
+ * [internal] Internal ROM modules (array_dataset, enumerable_dataset, auto_curry, and data_proxy) were moved from rom-support to ROM itself (flash-gordon)
142
+ * [internal] rom-support dependency was removed (flash-gordon)
143
+
144
+ [Compare v2.0.2...v3.0.0](https://github.com/rom-rb/rom/compare/v2.0.2...v3.0.0)
145
+
146
+ # v2.0.2 2016-11-11
147
+
148
+ ## Added
149
+
150
+ * API docs for `ROM::Container` (solnic)
151
+
152
+ ## Fixed
153
+
154
+ * Custom command input function is no longer overridden by schema hash (solnic)
155
+ * `Relation::Name#to_s` returns a string properly when there is no alias (solnic)
156
+
157
+ [Compare v2.0.1...v2.0.2](https://github.com/rom-rb/rom/compare/v2.0.1...v2.0.2)
158
+
159
+ # v2.0.1 2016-09-30
160
+
161
+ ### Added
162
+
163
+ - Support for different auto-registration strategies (janjiss)
164
+ - Support for custom component dir names in auto-registration (AMHOL)
165
+
166
+ ### Fixed
167
+
168
+ - Finalizing schema that is already finalized no longer crashes (flash-gordon)
169
+
170
+ [Compare v2.0.0...v2.0.1](https://github.com/rom-rb/rom/compare/v2.0.0...v2.0.1)
171
+
172
+ # v2.0.0 2016-07-27
173
+
174
+ ### Added
175
+
176
+ - Extendible `schema` DSL for relations with attribute and type definitions (solnic)
177
+ - New command plugin `:schema` which will set up an input handler from schema definition (solnic)
178
+ - New command option `restrictible` for commands that can use a restricted relation (solnic)
179
+ - More meaningful exception is raised when trying to access a non-existant command (thiagoa)
180
+ - `Relation::Name` class that contains both relation and dataset names (flash-gordon)
181
+ - `Relation::Loaded#pluck` returning values under specified key (solnic)
182
+ - `Relation::Loaded#primary_keys` returning a list of primary keys from a materialized relation (solnic)
183
+
184
+ #### New low-level APIs
185
+
186
+ - `Command.create_class` for building a command class dynamically (solnic)
187
+ - `Command.extend_for_relation` for extending a command with relation view interface (solnic)
188
+
189
+ ### Fixed
190
+
191
+ - [BREAKING] command graphs return materialized results (a hash or an array) (solnic)
192
+ - `Container#disconnect` properly delegates to gateways (endash)
193
+ - `Relation#with` properly carries original options (solnic)
194
+ - Command pipeline will stop processing if result was `nil` or an empty array (solnic)
195
+
196
+ ### Changed
197
+
198
+ - [BREAKING] `ROM.env` **is gone** (solnic)
199
+ - [BREAKING] `Update` and `Delete` no longer calls `assert_tuple_count` [more info](https://github.com/rom-rb/rom/commit/bec2c4c1dce370670c90f529feb1b4db0e6e4bd9) (solnic)
200
+ - [BREAKING] `Relation#name` and `Command#name` now returns `Relation::Name` instance (flash-gordon)
201
+ - `Command.validator` is now deprecated [more info](https://github.com/rom-rb/rom/commit/80bb8411bd411f05d9c51106ae026ad412a2f25f) (solnic)
202
+ - `Relation.dataset` yields a relation class when block was passed (solnic)
203
+ - `Relation#attributes` can return attributes explicitly passed via options (solnic)
204
+ - Relation `:key_inference` plugin supports schema information from other relations (solnic)
205
+ - `auto_registration` coerces its directory to a pathname now (adz)
206
+ - `macros` are now enabled by default in in-line setup block (endash)
207
+
208
+ [Compare v1.0.0...v2.0.0](https://github.com/rom-rb/rom/compare/v1.0.0...v2.0.0)
209
+
210
+ # v1.0.0 2016-01-06
211
+
212
+ ### Added
213
+
214
+ - Command graph DSL (endash + solnic)
215
+ - Command graph now supports update and delete commands (cflipse + solnic)
216
+ - `Gateway.adapter` setting and a corresponding `Gateway#adapter` reader. Both are
217
+ necessary to access a migrator (nepalez)
218
+ - `ROM::Commands::Result#{success?,failure?}` interface (Snuff)
219
+ - Imported relation plugins from `rom-repository`:
220
+ - `view` for explicit relation view definitions
221
+ - `key_inference` for inferring `foreign_key` of a relation
222
+
223
+ ### Changed
224
+
225
+ - **REMOVED** all deprecated APIs (solnic)
226
+ - [fixed #306] Inheriting from a misconfigured adapter relation will raise a
227
+ meaningful error (solnic)
228
+ - Command graph will raise `ROM::KeyMissing` command error when a key is missing
229
+ in the input (solnic)
230
+ - Command graph no longer rescues from any exception (solnic)
231
+
232
+ ### Fixed
233
+
234
+ - `Relation.register_as` properly overrides inherited value (solnic)
235
+
236
+ [Compare v0.9.1...v1.0.0](https://github.com/rom-rb/rom/compare/v0.9.1...v1.0.0)
237
+
238
+ # v0.9.1 2015-08-21
239
+
240
+ This is a small bug-fix release which addresses a couple of issues for inline
241
+ setup DSL and multi-environments.
242
+
243
+ ### Fixed
244
+
245
+ - Multi-env setup for adapters with schema-inferration support won't crash (solnic)
246
+ - Default adapter is set correctly when many adapters are configured and one is
247
+ registered under `:default` name (solnic)
248
+ - When defining a relation using inline DSL with custom dataset name the relation
249
+ name will be correctly set as `register_as` setting (solnic)
250
+
251
+ ### Changed
252
+
253
+ - When using inline-setup for env the auto_registration mechanism will be turned
254
+ on by default (solnic)
255
+
256
+ [Compare v0.9.0...v0.9.1](https://github.com/rom-rb/rom/compare/v0.9.0...v0.9.1)
257
+
258
+ # v0.9.0 2015-08-19
259
+
260
+ ### Added
261
+
262
+ * Configuration API for gateways supporting following options:
263
+ - `infer_relations` either `true` or `false` - if disabled schema inference
264
+ won't be used to automatically set up relations for you
265
+ - `inferrable_relations` a list of allowed relations that should be inferred
266
+ - `not_inferrable_relations` a list of relations that should not be inferred
267
+
268
+ ### Changed
269
+
270
+ * Global setup with auto-registration ported to the `:auto_registration` environment plugin (AMHOL)
271
+ * Multi-environment setup possible now via `ROM::Environment` object (AMHOL)
272
+ * All relations are now lazy with auto-currying enabled (solnic)
273
+ * Low-level query DSL provided by adapters is now public but using it directly in
274
+ application layer is discouraged (solnic)
275
+ * `ROM::Mapper` component extracted into standalone `rom-mapper` gem (solnic)
276
+ * Support libraries extracted to `rom-support` gem (solnic)
277
+
278
+ ## Fixed
279
+
280
+ * `register_as` is now properly inferred for relations and their descendants (solnic)
281
+ * Adapter-specific interface is properly included in relation descendants (solnic)
282
+ * Combined commands (aka command graph) properly rejects keys from nested input
283
+ prior sending the input to individual commands (solnic)
284
+ * Composite relation materializes correctly when another composite on the right
285
+ side became materialized (ie piping relation through a composite relation will
286
+ work correctly) (solnic)
287
+
288
+ [Compare v0.8.1...v0.9.0](https://github.com/rom-rb/rom/compare/v0.8.1...v0.9.0)
289
+
290
+ # v0.8.1 2015-07-12
291
+
292
+ ### Fixed
293
+
294
+ * `ROM::CommandError` properly sets original error and backtrace (solnic)
295
+
296
+ ### Changed
297
+
298
+ * Internal transproc processor has been updated to the new API (solnic)
299
+
300
+ [Compare v0.8.0...v0.8.1](https://github.com/rom-rb/rom/compare/v0.8.0...v0.8.1)
301
+
302
+ # v0.8.0 2015-06-22
303
+
304
+ ### Added
305
+
306
+ * Commands can be combined into a single command that can work with a nested input (solnic)
307
+ * New `step` mapper operation that allows multistep transformations inside a single mapper (dekz)
308
+ * New `ungroup` and `unfold` mapper operations inverse `group` and `fold` (nepalez)
309
+ * Support deep nesting of `unwrap` mapper operations (nepalez)
310
+ * Support usage of `exclude` in a root of the mapper (nepalez)
311
+ * Support usage of `prefix` and `prefix_separator` mapper operations inside blocks (nepalez)
312
+ * Support renaming of the rest of an attribute after `unwrap` (nepalez)
313
+
314
+ ### Changed
315
+
316
+ * `Repository` class has been renamed to `Gateway` with proper deprecation
317
+ warnings (cflipse)
318
+ * `combine` in mapper can be used without a block (kwando)
319
+ * `wrap` and `group` in mapper will raise error if `:mapper` is set along with
320
+ block or options (vrish88)
321
+
322
+ ### Fixed
323
+
324
+ * `order` memory repository operation sorts tuples containing empty values (nepalez)
325
+ * `Mapper::AttributeDSL#embedded` now honors `option[:type]` when used
326
+ with `option[:mapper]` (c0)
327
+
328
+ [Compare v0.7.1...v0.8.0](https://github.com/rom-rb/rom/compare/v0.7.1...v0.8.0)
329
+
330
+ # v0.7.1 2015-05-22
331
+
332
+ ### Added
333
+
334
+ * Support for passing a block for custom coercion to `attribute` (gotar)
335
+ * `fold` mapping operation which groups keys from input tuples to array
336
+ of values from the first of listed keys (nepalez)
337
+ * Adapter `Relation` and command classes can specify `adapter` identifier
338
+ which allows using adapter-specific plugins w/o the need to specify adapter
339
+ when calling `use` (solnic)
340
+
341
+ ### Changed
342
+
343
+ * [rom/memory] `restrict` operation supports array as a value (gotar)
344
+ * [rom/memory] `restrict` operation supports regexp as a value (gotar)
345
+
346
+ [Compare v0.7.0...v0.7.1](https://github.com/rom-rb/rom/compare/v0.7.0...v0.7.1)
347
+
348
+ # v0.7.0 2015-05-17
349
+
350
+ ### Added
351
+
352
+ * `combine` interface in Relation and Mapper which allows simple and explicit
353
+ eager-loading that works with all adapters (solnic)
354
+ * `reject_keys` option in mapper which will filter out unspecified keys from
355
+ input tuples (solnic)
356
+ * `unwrap` mapping operation (aflatter)
357
+ * Arbitrary objects can be registered as mappers via `register` in mapping DSL (solnic)
358
+ * Ability to reuse existing mappers in `group`, `wrap` and `embedded` mappings (solnic)
359
+ * Plugin interface for Relation, Mapper and Command (cflipse)
360
+ * `Memory::Dataset` accepts options hash now which makes it more flexible for
361
+ any adapter that wants to subclass it (solnic)
362
+ * `ROM::Memory::Relation#take` (solnic)
363
+
364
+ ### Changed
365
+
366
+ * [BREAKING] `Command#call` applies curried args first (solnic)
367
+ * `Commands::Update#set` was deprecated in favor of `call` (solnic)
368
+ * `group` mapping reject empty tuples (solnic)
369
+
370
+ ### Fixed
371
+
372
+ * `Command` respond to missing properly now (solnic)
373
+ * `Mapper::DSL` respond to missing properly now (solnic)
374
+
375
+ ### Internal
376
+
377
+ * Fixed all the warnings \o/ (splattael)
378
+ * Introduced `Deprecations` helper module (solnic)
379
+
380
+ [Compare v0.6.2...v0.7.0](https://github.com/rom-rb/rom/compare/v0.6.2...v0.7.0)
381
+
382
+ # v0.6.2 2015-04-14
383
+
384
+ ### Changed
385
+
386
+ * Updated to transproc 0.2.0 (solnic)
387
+
388
+ ### Fixed
389
+
390
+ * `CommandRegistry#respond_to_missing?` behavior (hecrj)
391
+
392
+ [Compare v0.6.1...v0.6.2](https://github.com/rom-rb/rom/compare/v0.6.1...v0.6.2)
393
+
394
+ # v0.6.1 2015-04-04
395
+
396
+ ### Added
397
+
398
+ * Ability to auto-map command result via `rom.command(:rel_name).as(:mapper_name)` (solnic)
399
+
400
+ ### Changed
401
+
402
+ * gemspec no longer specifies required_ruby_version so that rom can be installed on jruby (solnic)
403
+ * Obsolete `Env#readers` was removed (splattael)
404
+
405
+ [Compare v0.6.0...v0.6.1](https://github.com/rom-rb/rom/compare/v0.6.0...v0.6.1)
406
+
407
+ # v0.6.0 2015-03-22
408
+
409
+ ### Added
410
+
411
+ * It is now possible to define custom relation, mapper and command classes during setup (solnic)
412
+ * New `Env#relation` interface for reading and mapping relations which supports:
413
+ * `Relation::Lazy` with auto-currying, mapping and composition features (solnic)
414
+ * `Relation::Composite` allowing data-pipelining with arbitrary objects (solnic)
415
+ * Passing a block which yields relation with adapter query DSL available (solnic)
416
+ * Relations can be extended with plugins using Options API (solnic)
417
+ * Commands are now composable via `>>` operator (solnic)
418
+ * Mappers support `prefix_separator` option (solnic)
419
+ * Mappers can be registered under custom names (solnic)
420
+ * Relation `dataset` name is inferred from the class name by default (gotar)
421
+ * Relation can be registered under a custom name via `register_as` option (mcls)
422
+ * Adapters can use helper modules for datasets: `ArrayDataset` and `EnumerableDataset` (solnic)
423
+ * Adapter interface can now be tested via a lint test (elskwid + solnic + splattael)
424
+ * `tuple_count` interface in AbstractCommand which can be overridden by adapter (solnic)
425
+ * Custom Inflector API that auto-detects a specific inflection engine (mjtko)
426
+
427
+ ### Changed
428
+
429
+ * [BREAKING] Schema DSL was **removed** - attributes can be specified only in mapper DSL
430
+ * [BREAKING] Reader was **removed** in favor of relation interface with explicit mapping (solnic)
431
+ * [BREAKING] Command API was simplified - commands should be accessed directly in `.try` block
432
+ and default repository can be changed when defining a relation (solnic)
433
+ * `.setup` interface requires either an adapter identifier or can accept a repository
434
+ instance (aflatter)
435
+ * Adapter interface no longer requires specific constructor to be defined (aflatter)
436
+ * Adapters no longer need to handle connection URIs (aflatter)
437
+ * Adapter/Repository has been collapsed to *just* `Repository` (solnic)
438
+ * Relation no longer needs a header object and only operates on an adapters dataset (solnic)
439
+ * Relation no longer uses on Charlatan with method_missing magic (solnic)
440
+ * Adapter's dataset no longer requires header (solnic)
441
+ * Make storage in memory adapter thread-safe #110 (splattael)
442
+ * An Adapter can provide its own Relation subclass with custom behavior (solnic)
443
+ * Relation provides its "public interface" using method_added hook (splattael + solnic)
444
+ * ROM no longer depends on charlatan, concord and inflecto gems (mjtko + solnic)
445
+
446
+ [Compare v0.5.0...v0.6.0](https://github.com/rom-rb/rom/compare/v0.5.0...v0.6.0)
447
+
448
+ # v0.5.0 2014-12-31
449
+
450
+ ### Added
451
+
452
+ * Mapper DSL supports `embedded` interface for nested tuples (solnic)
453
+ * Support for nested `group` mapping (solnic)
454
+ * Support for nested `wrap` mapping (solnic)
455
+ * Support for primitive type coercions (:to_string, :to_integer etc.) (solnic)
456
+ * Support for top-level `:prefix` option in mapping DSL (solnic)
457
+ * Support for top-level `:symbolize_keys` option in mapping DSL (solnic)
458
+ * Support for `:prefix` option in wrap/group mapping DSL (solnic)
459
+ * Interface for registering data mapping processors (solnic)
460
+ * Remaining relations are automatically setup from the schema (solnic)
461
+ * Each relation has now access to other relations (previously they only had
462
+ access to raw datasets) (solnic)
463
+ * `ROM.setup` supports passing in *just an uri* which will setup a default repository (solnic)
464
+ * `ROM.setup` supports passing in conventional database connection hash (solnic)
465
+ * Adapters support extra options in addition to the base connection URI (solnic)
466
+
467
+ ### Changed
468
+
469
+ * Mapping backend replaced by integration with transproc (solnic)
470
+ * Readers no longer expose adapter query DSL (solnic)
471
+ * Registry objects raise `ROM::Registry::ElementNotFoundError` when missing
472
+ element is referenced (rather than raw KeyError) (solnic)
473
+ * Performance improvements in Reader (solnic)
474
+ * `ROM::RA` was merged into in-memory adapter as this fits there perfectly (solnic)
475
+ * It is no longer needed to explicitly execute a delete command in try block (solnic)
476
+
477
+ ### Fixed
478
+
479
+ * Wrap/group skips empty tuples now (solnic)
480
+ * Readers raise a meaningful error when relation is missing (solnic)
481
+
482
+ ## Internal
483
+
484
+ * Massive code clean-up and rubocop integration (chastell)
485
+ * Refactored `Reader` and mapper-specific logic into `MapperRegistry` (solnic)
486
+
487
+ [Compare v0.4.2...v0.5.0](https://github.com/rom-rb/rom/compare/v0.4.2...v0.5.0)
488
+
489
+ # v0.4.2 2014-12-19
490
+
491
+ ### Added
492
+
493
+ * Mappers support tuple transformation using wrap and group operations (solnic)
494
+ * PORO model builder supports namespaced constants via `name: 'MyApp:Entities::User` (solnic)
495
+
496
+ ### Changed
497
+
498
+ * `ROM::RA` interface is no longer mixed into relations by default (solnic)
499
+ * ~2.5 x speed up in aggregate mapping (solnic)
500
+ * PORO model builder only defines attribute readers now (no writers!) (solnic)
501
+ * Registry objects in Env will now raise `KeyError` when unknown name is referenced (solnic)
502
+
503
+ [Compare v0.4.1...v0.4.2](https://github.com/rom-rb/rom/compare/v0.4.1...v0.4.2)
504
+
505
+ # v0.4.1 2014-12-15
506
+
507
+ ### Added
508
+
509
+ * Adapter can now implement `Adapter#dataset(name, header)` to return a dataset (solnic)
510
+ * For multi-step setup the DSL is available in `ROM` too (solnic)
511
+ * Global environment can be stored via `ROM.finalize` and accessible via `ROM.env` (solnic)
512
+ * Mapper won't infer attributes from the header if `:inherit_header` option is set to false (solnic)
513
+
514
+ ### Changed
515
+
516
+ * Schema can be defined in multiple steps (solnic)
517
+ * Setting model in mapper DSL is no longer required and defaults to `Hash` (solnic)
518
+ * Adapter datasets no longer have to return headers when they are provided by schema (solnic)
519
+
520
+ [Compare v0.4.0...v0.4.1](https://github.com/rom-rb/rom/compare/v0.4.0...v0.4.1)
521
+
522
+ # v0.4.0 2014-12-06
523
+
524
+ ### Added
525
+
526
+ * Command API (solnic)
527
+ * Setup DSL is now available within the `ROM.setup` block (solnic)
528
+ * Support for setting up a logger for an adapter (solnic)
529
+ * New `Adapter#dataset?(name)` which every adapter must implement (solnic)
530
+
531
+ ### Fixed
532
+
533
+ * method-missing in `Repository` and `Env` kindly calls `super` (solnic)
534
+
535
+ ### Changed
536
+
537
+ * Abstract `Adapter` defines `:connection` reader so it doesn't have to be
538
+ defined in adapter descendants (solnic)
539
+
540
+ [Compare v0.3.1...v0.4.0](https://github.com/rom-rb/rom/compare/v0.3.1...v0.4.0)
541
+
542
+ # v0.3.1 2014-11-25
543
+
544
+ ### Added
545
+
546
+ * attributes for `group` mapping operation can be specified without options (solnic)
547
+ * attributes for `wrap` mapping operation can be specified without options (solnic)
548
+ * `Env` uses Equalizer (solnic)
549
+ * boot dsl methods return self (solnic)
550
+
551
+ ### Fixed
552
+
553
+ * when schema is missing booting will gracefuly skip building relations and mappers (solnic)
554
+ * in-memory join handles one-to-many and many-to-one correctly (solnic)
555
+
556
+ [Compare v0.3.0...v0.3.1](https://github.com/rom-rb/rom/compare/v0.3.0...v0.3.1)
557
+
558
+ # v0.3.0 2014-11-24
559
+
560
+ This version is a rewrite that introduces a new, simplified architecture based
561
+ on a new adapter interface.
562
+
563
+ [Compare v0.2.0...v0.3.0](https://github.com/rom-rb/rom/compare/v0.2.0...v0.3.0)
564
+
565
+ # v0.2.0 2014-04-06
566
+
567
+ ### Added
568
+
569
+ * [feature] added :rename option to schema attribute DSL (solnic)
570
+ * [feature] added support for join, group, wrap, project and rename operations (solnic)
571
+ * [feature] added support for setting domain object loading strategy (solnic)
572
+ * [feature] Environment.setup can be used with a block to define schema and mapping (solnic)
573
+ * [feature] added public interface for building mappers (see Mapper.build) (solnic)
574
+ * [feature] added support for mapping embedded objects using wrap/group (solnic)
575
+ * [feature] environment exposes mapper registry via Environment#mappers (solnic)
576
+
577
+ ### Changed
578
+
579
+ * [BREAKING] rom-relation, rom-mapper and rom-session were merged into rom project (solnic)
580
+ * [BREAKING] changed mapping DSL (users do...end => relation(:users) do...end) (solnic)
581
+ * [BREAKING] added :from option to mapping DSL which replaced :to (solnic)
582
+ * [internal] mappers are now backed by [morpher](https://github.com/mbj/morpher) (solnic)
583
+ * [internal] renaming and optimizing relations happens on the schema level now (solnic)
584
+ * [internal] environment will raise if unknown relation is referenced via `Environment#[]` (solnic)
585
+
586
+ [Compare v0.1.2...v0.2.0](https://github.com/rom-rb/rom/compare/v0.1.2...v0.2.0)
587
+
588
+ # v0.1.2 2013-09-02
589
+
590
+ * [updated] [rom-relation](https://github.com/rom-rb/rom-relation/blob/v0.1.2/Changelog.md#v012-2013-09-02)
591
+
592
+ [Compare v0.1.1...v0.1.2](https://github.com/rom-rb/rom/compare/v0.1.1...v0.1.2)
593
+
594
+ # v0.1.1 2013-08-30
595
+
596
+ * [updated] [rom-relation](https://github.com/rom-rb/rom-relation/blob/v0.1.1/Changelog.md#v011-2013-08-30)
597
+ * [updated] [rom-session](https://github.com/rom-rb/rom-session/blob/v0.1.1/Changelog.md#v011-2013-08-30)
598
+
599
+ [Compare v0.1.0...v0.1.1](https://github.com/rom-rb/rom/compare/v0.1.0...v0.1.1)
600
+
601
+ # v0.1.0 2013-08-23
602
+
603
+ First public release