couchbase-orm 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +45 -0
  3. data/.gitignore +2 -0
  4. data/.travis.yml +5 -4
  5. data/CODEOWNERS +1 -0
  6. data/Gemfile +5 -3
  7. data/README.md +237 -31
  8. data/ci/run_couchbase.sh +22 -0
  9. data/couchbase-orm.gemspec +26 -20
  10. data/lib/couchbase-orm/active_record_compat.rb +92 -0
  11. data/lib/couchbase-orm/associations.rb +119 -0
  12. data/lib/couchbase-orm/base.rb +143 -166
  13. data/lib/couchbase-orm/changeable.rb +512 -0
  14. data/lib/couchbase-orm/connection.rb +28 -8
  15. data/lib/couchbase-orm/encrypt.rb +48 -0
  16. data/lib/couchbase-orm/error.rb +17 -2
  17. data/lib/couchbase-orm/inspectable.rb +37 -0
  18. data/lib/couchbase-orm/json_schema/json_validation_error.rb +13 -0
  19. data/lib/couchbase-orm/json_schema/loader.rb +47 -0
  20. data/lib/couchbase-orm/json_schema/validation.rb +18 -0
  21. data/lib/couchbase-orm/json_schema/validator.rb +45 -0
  22. data/lib/couchbase-orm/json_schema.rb +9 -0
  23. data/lib/couchbase-orm/json_transcoder.rb +27 -0
  24. data/lib/couchbase-orm/locale/en.yml +5 -0
  25. data/lib/couchbase-orm/n1ql.rb +133 -0
  26. data/lib/couchbase-orm/persistence.rb +67 -50
  27. data/lib/couchbase-orm/proxies/bucket_proxy.rb +36 -0
  28. data/lib/couchbase-orm/proxies/collection_proxy.rb +52 -0
  29. data/lib/couchbase-orm/proxies/n1ql_proxy.rb +40 -0
  30. data/lib/couchbase-orm/proxies/results_proxy.rb +23 -0
  31. data/lib/couchbase-orm/railtie.rb +6 -17
  32. data/lib/couchbase-orm/relation.rb +249 -0
  33. data/lib/couchbase-orm/strict_loading.rb +21 -0
  34. data/lib/couchbase-orm/timestamps/created.rb +20 -0
  35. data/lib/couchbase-orm/timestamps/updated.rb +21 -0
  36. data/lib/couchbase-orm/timestamps.rb +15 -0
  37. data/lib/couchbase-orm/types/array.rb +32 -0
  38. data/lib/couchbase-orm/types/date.rb +9 -0
  39. data/lib/couchbase-orm/types/date_time.rb +14 -0
  40. data/lib/couchbase-orm/types/encrypted.rb +17 -0
  41. data/lib/couchbase-orm/types/nested.rb +43 -0
  42. data/lib/couchbase-orm/types/timestamp.rb +18 -0
  43. data/lib/couchbase-orm/types.rb +20 -0
  44. data/lib/couchbase-orm/utilities/enum.rb +13 -1
  45. data/lib/couchbase-orm/utilities/has_many.rb +72 -36
  46. data/lib/couchbase-orm/utilities/ignored_properties.rb +15 -0
  47. data/lib/couchbase-orm/utilities/index.rb +23 -8
  48. data/lib/couchbase-orm/utilities/properties_always_exists_in_document.rb +16 -0
  49. data/lib/couchbase-orm/utilities/query_helper.rb +148 -0
  50. data/lib/couchbase-orm/utils.rb +25 -0
  51. data/lib/couchbase-orm/version.rb +1 -1
  52. data/lib/couchbase-orm/views.rb +38 -41
  53. data/lib/couchbase-orm.rb +44 -9
  54. data/lib/ext/query_n1ql.rb +124 -0
  55. data/lib/rails/generators/couchbase_orm/config/templates/couchbase.yml +3 -2
  56. data/spec/associations_spec.rb +219 -50
  57. data/spec/base_spec.rb +296 -14
  58. data/spec/collection_proxy_spec.rb +29 -0
  59. data/spec/connection_spec.rb +27 -0
  60. data/spec/couchbase-orm/active_record_compat_spec.rb +24 -0
  61. data/spec/couchbase-orm/changeable_spec.rb +16 -0
  62. data/spec/couchbase-orm/json_schema/validation_spec.rb +23 -0
  63. data/spec/couchbase-orm/json_schema/validator_spec.rb +13 -0
  64. data/spec/couchbase-orm/timestamps_spec.rb +85 -0
  65. data/spec/couchbase-orm/timestamps_spec_models.rb +36 -0
  66. data/spec/empty-json-schema/.gitkeep +0 -0
  67. data/spec/enum_spec.rb +34 -0
  68. data/spec/has_many_spec.rb +101 -54
  69. data/spec/index_spec.rb +55 -8
  70. data/spec/json-schema/JsonSchemaBaseTest.json +19 -0
  71. data/spec/json-schema/entity_snakecase.json +20 -0
  72. data/spec/json-schema/loader_spec.rb +42 -0
  73. data/spec/json-schema/specific_path.json +20 -0
  74. data/spec/json_schema_spec.rb +178 -0
  75. data/spec/n1ql_spec.rb +193 -0
  76. data/spec/persistence_spec.rb +49 -9
  77. data/spec/relation_nested_spec.rb +88 -0
  78. data/spec/relation_spec.rb +430 -0
  79. data/spec/support.rb +16 -8
  80. data/spec/type_array_spec.rb +52 -0
  81. data/spec/type_encrypted_spec.rb +114 -0
  82. data/spec/type_nested_spec.rb +191 -0
  83. data/spec/type_spec.rb +317 -0
  84. data/spec/utilities/ignored_properties_spec.rb +20 -0
  85. data/spec/utilities/properties_always_exists_in_document_spec.rb +24 -0
  86. data/spec/views_spec.rb +34 -13
  87. metadata +192 -29
metadata CHANGED
@@ -1,49 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase-orm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
- autorequire:
8
+ - Gauthier Monserand
9
+ - Pierre Merlin
10
+ - Julien Burnet-Fauche
11
+ autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
- date: 2017-10-31 00:00:00.000000000 Z
14
+ date: 2024-06-17 00:00:00.000000000 Z
12
15
  dependencies:
13
16
  - !ruby/object:Gem::Dependency
14
- name: libcouchbase
17
+ name: activemodel
15
18
  requirement: !ruby/object:Gem::Requirement
16
19
  requirements:
17
- - - "~>"
20
+ - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '1.2'
22
+ version: '5.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '1.2'
29
+ version: '5.2'
27
30
  - !ruby/object:Gem::Dependency
28
- name: activemodel
31
+ name: couchbase
29
32
  requirement: !ruby/object:Gem::Requirement
30
33
  requirements:
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
- version: '4.0'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '6.0'
36
+ version: 3.4.2
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '4.0'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '6.0'
43
+ version: 3.4.2
47
44
  - !ruby/object:Gem::Dependency
48
45
  name: radix
49
46
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +55,20 @@ dependencies:
58
55
  - - "~>"
59
56
  - !ruby/object:Gem::Version
60
57
  version: '2.2'
58
+ - !ruby/object:Gem::Dependency
59
+ name: json-schema
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '3'
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '3'
61
72
  - !ruby/object:Gem::Dependency
62
73
  name: rake
63
74
  requirement: !ruby/object:Gem::Requirement
@@ -101,65 +112,194 @@ dependencies:
101
112
  - !ruby/object:Gem::Version
102
113
  version: '0.9'
103
114
  - !ruby/object:Gem::Dependency
104
- name: minitest
115
+ name: pry
105
116
  requirement: !ruby/object:Gem::Requirement
106
117
  requirements:
107
- - - "~>"
118
+ - - ">="
108
119
  - !ruby/object:Gem::Version
109
- version: '5.10'
120
+ version: '0'
110
121
  type: :development
111
122
  prerelease: false
112
123
  version_requirements: !ruby/object:Gem::Requirement
113
124
  requirements:
114
- - - "~>"
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ - !ruby/object:Gem::Dependency
129
+ name: pry-stack_explorer
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: simplecov
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ type: :development
150
+ prerelease: false
151
+ version_requirements: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ - !ruby/object:Gem::Dependency
157
+ name: actionpack
158
+ requirement: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ - !ruby/object:Gem::Dependency
171
+ name: timecop
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ type: :development
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ - !ruby/object:Gem::Dependency
185
+ name: base64
186
+ requirement: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ type: :development
192
+ prerelease: false
193
+ version_requirements: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - ">="
115
196
  - !ruby/object:Gem::Version
116
- version: '5.10'
197
+ version: '0'
117
198
  description: A Couchbase ORM for Rails
118
199
  email:
119
- - steve@cotag.me
120
200
  executables: []
121
201
  extensions: []
122
202
  extra_rdoc_files: []
123
203
  files:
204
+ - ".github/workflows/test.yml"
124
205
  - ".gitignore"
125
206
  - ".rspec"
126
207
  - ".travis.yml"
208
+ - CODEOWNERS
127
209
  - Gemfile
128
210
  - LICENSE
129
211
  - README.md
130
212
  - Rakefile
213
+ - ci/run_couchbase.sh
131
214
  - couchbase-orm.gemspec
132
215
  - lib/couchbase-orm.rb
216
+ - lib/couchbase-orm/active_record_compat.rb
133
217
  - lib/couchbase-orm/associations.rb
134
218
  - lib/couchbase-orm/base.rb
219
+ - lib/couchbase-orm/changeable.rb
135
220
  - lib/couchbase-orm/connection.rb
221
+ - lib/couchbase-orm/encrypt.rb
136
222
  - lib/couchbase-orm/error.rb
137
223
  - lib/couchbase-orm/id_generator.rb
224
+ - lib/couchbase-orm/inspectable.rb
225
+ - lib/couchbase-orm/json_schema.rb
226
+ - lib/couchbase-orm/json_schema/json_validation_error.rb
227
+ - lib/couchbase-orm/json_schema/loader.rb
228
+ - lib/couchbase-orm/json_schema/validation.rb
229
+ - lib/couchbase-orm/json_schema/validator.rb
230
+ - lib/couchbase-orm/json_transcoder.rb
231
+ - lib/couchbase-orm/locale/en.yml
232
+ - lib/couchbase-orm/n1ql.rb
138
233
  - lib/couchbase-orm/persistence.rb
234
+ - lib/couchbase-orm/proxies/bucket_proxy.rb
235
+ - lib/couchbase-orm/proxies/collection_proxy.rb
236
+ - lib/couchbase-orm/proxies/n1ql_proxy.rb
237
+ - lib/couchbase-orm/proxies/results_proxy.rb
139
238
  - lib/couchbase-orm/railtie.rb
239
+ - lib/couchbase-orm/relation.rb
240
+ - lib/couchbase-orm/strict_loading.rb
241
+ - lib/couchbase-orm/timestamps.rb
242
+ - lib/couchbase-orm/timestamps/created.rb
243
+ - lib/couchbase-orm/timestamps/updated.rb
244
+ - lib/couchbase-orm/types.rb
245
+ - lib/couchbase-orm/types/array.rb
246
+ - lib/couchbase-orm/types/date.rb
247
+ - lib/couchbase-orm/types/date_time.rb
248
+ - lib/couchbase-orm/types/encrypted.rb
249
+ - lib/couchbase-orm/types/nested.rb
250
+ - lib/couchbase-orm/types/timestamp.rb
140
251
  - lib/couchbase-orm/utilities/ensure_unique.rb
141
252
  - lib/couchbase-orm/utilities/enum.rb
142
253
  - lib/couchbase-orm/utilities/has_many.rb
254
+ - lib/couchbase-orm/utilities/ignored_properties.rb
143
255
  - lib/couchbase-orm/utilities/index.rb
144
256
  - lib/couchbase-orm/utilities/join.rb
257
+ - lib/couchbase-orm/utilities/properties_always_exists_in_document.rb
258
+ - lib/couchbase-orm/utilities/query_helper.rb
259
+ - lib/couchbase-orm/utils.rb
145
260
  - lib/couchbase-orm/version.rb
146
261
  - lib/couchbase-orm/views.rb
262
+ - lib/ext/query_n1ql.rb
147
263
  - lib/rails/generators/couchbase_orm/config/config_generator.rb
148
264
  - lib/rails/generators/couchbase_orm/config/templates/couchbase.yml
149
265
  - lib/rails/generators/couchbase_orm_generator.rb
150
266
  - spec/associations_spec.rb
151
267
  - spec/base_spec.rb
268
+ - spec/collection_proxy_spec.rb
269
+ - spec/connection_spec.rb
270
+ - spec/couchbase-orm/active_record_compat_spec.rb
271
+ - spec/couchbase-orm/changeable_spec.rb
272
+ - spec/couchbase-orm/json_schema/validation_spec.rb
273
+ - spec/couchbase-orm/json_schema/validator_spec.rb
274
+ - spec/couchbase-orm/timestamps_spec.rb
275
+ - spec/couchbase-orm/timestamps_spec_models.rb
276
+ - spec/empty-json-schema/.gitkeep
277
+ - spec/enum_spec.rb
152
278
  - spec/has_many_spec.rb
153
279
  - spec/id_generator_spec.rb
154
280
  - spec/index_spec.rb
281
+ - spec/json-schema/JsonSchemaBaseTest.json
282
+ - spec/json-schema/entity_snakecase.json
283
+ - spec/json-schema/loader_spec.rb
284
+ - spec/json-schema/specific_path.json
285
+ - spec/json_schema_spec.rb
286
+ - spec/n1ql_spec.rb
155
287
  - spec/persistence_spec.rb
288
+ - spec/relation_nested_spec.rb
289
+ - spec/relation_spec.rb
156
290
  - spec/support.rb
291
+ - spec/type_array_spec.rb
292
+ - spec/type_encrypted_spec.rb
293
+ - spec/type_nested_spec.rb
294
+ - spec/type_spec.rb
295
+ - spec/utilities/ignored_properties_spec.rb
296
+ - spec/utilities/properties_always_exists_in_document_spec.rb
157
297
  - spec/views_spec.rb
158
- homepage: https://github.com/cotag/couchbase-orm
298
+ homepage: https://github.com/doctolib/couchbase-orm
159
299
  licenses:
160
300
  - MIT
161
301
  metadata: {}
162
- post_install_message:
302
+ post_install_message:
163
303
  rdoc_options: []
164
304
  require_paths:
165
305
  - lib
@@ -167,24 +307,47 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
307
  requirements:
168
308
  - - ">="
169
309
  - !ruby/object:Gem::Version
170
- version: 2.1.0
310
+ version: 2.7.0
171
311
  required_rubygems_version: !ruby/object:Gem::Requirement
172
312
  requirements:
173
313
  - - ">="
174
314
  - !ruby/object:Gem::Version
175
315
  version: '0'
176
316
  requirements: []
177
- rubyforge_project:
178
- rubygems_version: 2.6.14
179
- signing_key:
317
+ rubygems_version: 3.3.26
318
+ signing_key:
180
319
  specification_version: 4
181
320
  summary: Couchbase ORM for Rails
182
321
  test_files:
183
322
  - spec/associations_spec.rb
184
323
  - spec/base_spec.rb
324
+ - spec/collection_proxy_spec.rb
325
+ - spec/connection_spec.rb
326
+ - spec/couchbase-orm/active_record_compat_spec.rb
327
+ - spec/couchbase-orm/changeable_spec.rb
328
+ - spec/couchbase-orm/json_schema/validation_spec.rb
329
+ - spec/couchbase-orm/json_schema/validator_spec.rb
330
+ - spec/couchbase-orm/timestamps_spec.rb
331
+ - spec/couchbase-orm/timestamps_spec_models.rb
332
+ - spec/empty-json-schema/.gitkeep
333
+ - spec/enum_spec.rb
185
334
  - spec/has_many_spec.rb
186
335
  - spec/id_generator_spec.rb
187
336
  - spec/index_spec.rb
337
+ - spec/json-schema/JsonSchemaBaseTest.json
338
+ - spec/json-schema/entity_snakecase.json
339
+ - spec/json-schema/loader_spec.rb
340
+ - spec/json-schema/specific_path.json
341
+ - spec/json_schema_spec.rb
342
+ - spec/n1ql_spec.rb
188
343
  - spec/persistence_spec.rb
344
+ - spec/relation_nested_spec.rb
345
+ - spec/relation_spec.rb
189
346
  - spec/support.rb
347
+ - spec/type_array_spec.rb
348
+ - spec/type_encrypted_spec.rb
349
+ - spec/type_nested_spec.rb
350
+ - spec/type_spec.rb
351
+ - spec/utilities/ignored_properties_spec.rb
352
+ - spec/utilities/properties_always_exists_in_document_spec.rb
190
353
  - spec/views_spec.rb