activecypher 0.15.3 → 0.15.5
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/lib/active_cypher/associations.rb +185 -267
- data/lib/active_cypher/bolt/connection.rb +21 -41
- data/lib/active_cypher/bolt/transaction.rb +14 -2
- data/lib/active_cypher/connection_adapters/memgraph_adapter.rb +33 -10
- data/lib/active_cypher/connection_adapters/neo4j_adapter.rb +1 -1
- data/lib/active_cypher/connection_adapters/persistence_methods.rb +12 -15
- data/lib/active_cypher/connection_pool.rb +41 -20
- data/lib/active_cypher/fixtures.rb +34 -37
- data/lib/active_cypher/migration.rb +18 -15
- data/lib/active_cypher/rails_lens_ext/annotator.rb +15 -16
- data/lib/active_cypher/version.rb +1 -1
- data/lib/activecypher.rb +8 -0
- data/lib/cyrel/ast/compiler.rb +37 -28
- data/lib/cyrel/clause/set.rb +32 -28
- data/lib/cyrel/query.rb +2 -34
- metadata +2 -2
data/lib/cyrel/query.rb
CHANGED
|
@@ -213,40 +213,8 @@ module Cyrel
|
|
|
213
213
|
# @return [self]
|
|
214
214
|
# Because sometimes you just want to change everything and pretend it was always that way.
|
|
215
215
|
def set(assignments)
|
|
216
|
-
#
|
|
217
|
-
processed_assignments =
|
|
218
|
-
when Hash
|
|
219
|
-
assignments.flat_map do |key, value|
|
|
220
|
-
case key
|
|
221
|
-
when Expression::PropertyAccess
|
|
222
|
-
# SET n.prop = value
|
|
223
|
-
[[:property, key, Expression.coerce(value)]]
|
|
224
|
-
when Symbol, String
|
|
225
|
-
# SET n = properties
|
|
226
|
-
raise ArgumentError, 'Value for variable assignment must be a Hash' unless value.is_a?(Hash)
|
|
227
|
-
|
|
228
|
-
[[:variable_properties, key.to_sym, Expression.coerce(value), :assign]]
|
|
229
|
-
when Cyrel::Plus
|
|
230
|
-
# SET n += properties
|
|
231
|
-
raise ArgumentError, 'Value for variable assignment must be a Hash' unless value.is_a?(Hash)
|
|
232
|
-
|
|
233
|
-
[[:variable_properties, key.variable.to_sym, Expression.coerce(value), :merge]]
|
|
234
|
-
else
|
|
235
|
-
raise ArgumentError, "Invalid key type in SET assignments: #{key.class}"
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
when Array
|
|
239
|
-
assignments.map do |item|
|
|
240
|
-
unless item.is_a?(Array) && item.length == 2
|
|
241
|
-
raise ArgumentError, "Invalid label assignment format. Expected [[:variable, 'Label'], ...], got #{item.inspect}"
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
# SET n:Label
|
|
245
|
-
[:label, item[0].to_sym, item[1]]
|
|
246
|
-
end
|
|
247
|
-
else
|
|
248
|
-
raise ArgumentError, "Invalid assignments type: #{assignments.class}"
|
|
249
|
-
end
|
|
216
|
+
# Normalize assignments using the shared Set-clause logic
|
|
217
|
+
processed_assignments = Clause::Set.normalize_assignments(assignments)
|
|
250
218
|
|
|
251
219
|
set_node = AST::SetNode.new(processed_assignments)
|
|
252
220
|
ast_clause = AST::ClauseAdapter.new(set_node)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activecypher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.15.
|
|
4
|
+
version: 0.15.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdelkader Boudih
|
|
@@ -293,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
293
293
|
- !ruby/object:Gem::Version
|
|
294
294
|
version: '0'
|
|
295
295
|
requirements: []
|
|
296
|
-
rubygems_version: 4.0.
|
|
296
|
+
rubygems_version: 4.0.10
|
|
297
297
|
specification_version: 4
|
|
298
298
|
summary: OpenCypher Adapter ala ActiveRecord
|
|
299
299
|
test_files: []
|