rasti-db 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rasti/db.rb +11 -1
  3. data/lib/rasti/db/nql/filter_condition_strategies/base.rb +17 -0
  4. data/lib/rasti/db/nql/filter_condition_strategies/postgres.rb +21 -0
  5. data/lib/rasti/db/nql/filter_condition_strategies/sqlite.rb +21 -0
  6. data/lib/rasti/db/nql/filter_condition_strategies/types/generic.rb +49 -0
  7. data/lib/rasti/db/nql/filter_condition_strategies/types/pg_array.rb +32 -0
  8. data/lib/rasti/db/nql/filter_condition_strategies/types/sqlite_array.rb +34 -0
  9. data/lib/rasti/db/nql/filter_condition_strategies/unsupported_type_comparison.rb +22 -0
  10. data/lib/rasti/db/nql/nodes/array_content.rb +21 -0
  11. data/lib/rasti/db/nql/nodes/comparisons/base.rb +10 -0
  12. data/lib/rasti/db/nql/nodes/comparisons/equal.rb +0 -4
  13. data/lib/rasti/db/nql/nodes/comparisons/greater_than.rb +0 -4
  14. data/lib/rasti/db/nql/nodes/comparisons/greater_than_or_equal.rb +0 -4
  15. data/lib/rasti/db/nql/nodes/comparisons/include.rb +0 -4
  16. data/lib/rasti/db/nql/nodes/comparisons/less_than.rb +0 -4
  17. data/lib/rasti/db/nql/nodes/comparisons/less_than_or_equal.rb +0 -4
  18. data/lib/rasti/db/nql/nodes/comparisons/like.rb +0 -4
  19. data/lib/rasti/db/nql/nodes/comparisons/not_equal.rb +0 -4
  20. data/lib/rasti/db/nql/nodes/comparisons/not_include.rb +0 -4
  21. data/lib/rasti/db/nql/nodes/constants/array.rb +17 -0
  22. data/lib/rasti/db/nql/nodes/constants/base.rb +17 -0
  23. data/lib/rasti/db/nql/nodes/constants/false.rb +1 -1
  24. data/lib/rasti/db/nql/nodes/constants/float.rb +1 -1
  25. data/lib/rasti/db/nql/nodes/constants/integer.rb +1 -1
  26. data/lib/rasti/db/nql/nodes/constants/literal_string.rb +1 -1
  27. data/lib/rasti/db/nql/nodes/constants/string.rb +1 -1
  28. data/lib/rasti/db/nql/nodes/constants/time.rb +1 -1
  29. data/lib/rasti/db/nql/nodes/constants/true.rb +1 -1
  30. data/lib/rasti/db/nql/syntax.rb +229 -11
  31. data/lib/rasti/db/nql/syntax.treetop +24 -11
  32. data/lib/rasti/db/type_converters/sqlite.rb +62 -0
  33. data/lib/rasti/db/type_converters/sqlite_types/array.rb +34 -0
  34. data/lib/rasti/db/version.rb +1 -1
  35. data/rasti-db.gemspec +1 -0
  36. data/spec/collection_spec.rb +8 -0
  37. data/spec/minitest_helper.rb +4 -2
  38. data/spec/nql/filter_condition_spec.rb +19 -2
  39. data/spec/nql/filter_condition_strategies_spec.rb +112 -0
  40. data/spec/nql/syntax_parser_spec.rb +24 -0
  41. data/spec/query_spec.rb +89 -0
  42. data/spec/type_converters/sqlite_spec.rb +66 -0
  43. metadata +32 -2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasti-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2020-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -140,6 +140,20 @@ dependencies:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0.5'
143
+ - !ruby/object:Gem::Dependency
144
+ name: inflecto
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '0.0'
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '0.0'
143
157
  - !ruby/object:Gem::Dependency
144
158
  name: rake
145
159
  requirement: !ruby/object:Gem::Requirement
@@ -281,7 +295,15 @@ files:
281
295
  - lib/rasti/db/data_source.rb
282
296
  - lib/rasti/db/environment.rb
283
297
  - lib/rasti/db/model.rb
298
+ - lib/rasti/db/nql/filter_condition_strategies/base.rb
299
+ - lib/rasti/db/nql/filter_condition_strategies/postgres.rb
300
+ - lib/rasti/db/nql/filter_condition_strategies/sqlite.rb
301
+ - lib/rasti/db/nql/filter_condition_strategies/types/generic.rb
302
+ - lib/rasti/db/nql/filter_condition_strategies/types/pg_array.rb
303
+ - lib/rasti/db/nql/filter_condition_strategies/types/sqlite_array.rb
304
+ - lib/rasti/db/nql/filter_condition_strategies/unsupported_type_comparison.rb
284
305
  - lib/rasti/db/nql/invalid_expression_error.rb
306
+ - lib/rasti/db/nql/nodes/array_content.rb
285
307
  - lib/rasti/db/nql/nodes/attribute.rb
286
308
  - lib/rasti/db/nql/nodes/binary_node.rb
287
309
  - lib/rasti/db/nql/nodes/comparisons/base.rb
@@ -295,6 +317,8 @@ files:
295
317
  - lib/rasti/db/nql/nodes/comparisons/not_equal.rb
296
318
  - lib/rasti/db/nql/nodes/comparisons/not_include.rb
297
319
  - lib/rasti/db/nql/nodes/conjunction.rb
320
+ - lib/rasti/db/nql/nodes/constants/array.rb
321
+ - lib/rasti/db/nql/nodes/constants/base.rb
298
322
  - lib/rasti/db/nql/nodes/constants/false.rb
299
323
  - lib/rasti/db/nql/nodes/constants/float.rb
300
324
  - lib/rasti/db/nql/nodes/constants/integer.rb
@@ -319,6 +343,8 @@ files:
319
343
  - lib/rasti/db/type_converters/postgres_types/hstore.rb
320
344
  - lib/rasti/db/type_converters/postgres_types/json.rb
321
345
  - lib/rasti/db/type_converters/postgres_types/jsonb.rb
346
+ - lib/rasti/db/type_converters/sqlite.rb
347
+ - lib/rasti/db/type_converters/sqlite_types/array.rb
322
348
  - lib/rasti/db/type_converters/time_in_zone.rb
323
349
  - lib/rasti/db/version.rb
324
350
  - rasti-db.gemspec
@@ -330,10 +356,12 @@ files:
330
356
  - spec/nql/computed_attributes_spec.rb
331
357
  - spec/nql/dependency_tables_spec.rb
332
358
  - spec/nql/filter_condition_spec.rb
359
+ - spec/nql/filter_condition_strategies_spec.rb
333
360
  - spec/nql/syntax_parser_spec.rb
334
361
  - spec/query_spec.rb
335
362
  - spec/relations_spec.rb
336
363
  - spec/type_converters/postgres_spec.rb
364
+ - spec/type_converters/sqlite_spec.rb
337
365
  - spec/type_converters/time_in_zone_spec.rb
338
366
  homepage: https://github.com/gabynaiman/rasti-db
339
367
  licenses:
@@ -367,8 +395,10 @@ test_files:
367
395
  - spec/nql/computed_attributes_spec.rb
368
396
  - spec/nql/dependency_tables_spec.rb
369
397
  - spec/nql/filter_condition_spec.rb
398
+ - spec/nql/filter_condition_strategies_spec.rb
370
399
  - spec/nql/syntax_parser_spec.rb
371
400
  - spec/query_spec.rb
372
401
  - spec/relations_spec.rb
373
402
  - spec/type_converters/postgres_spec.rb
403
+ - spec/type_converters/sqlite_spec.rb
374
404
  - spec/type_converters/time_in_zone_spec.rb