cypher_builder 0.0.4 → 0.0.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/cypher_builder/match.rb +1 -1
- data/lib/cypher_builder/version.rb +1 -1
- data/spec/cypher_builder/cypher_spec.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26225a58b1717350bda4fd81a734c492f7e60747
|
4
|
+
data.tar.gz: 31ccce0aaf2a0fbd9c720de956993b190b1381cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502ee59e86a94dd2bd5740b4e543ea0a2cfbc7e13fc3c1153ca6fe3579e3bd20414227e0d30b2568418d6df05305bf2de1062e5c8e0b7f476112cbf253e126d4
|
7
|
+
data.tar.gz: 74fd3360304f6f6a8c799f2eddbc584538f9a60a44cced4eec5d84a9d98755b0ef20fce25e4f747665f9b99715befdbc7eca3d55a7a6289101e9837a5f56c65e
|
data/lib/cypher_builder/match.rb
CHANGED
@@ -11,7 +11,7 @@ module CypherBuilder
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def as_cypher(payload:, context: )
|
14
|
-
resolve(@parts,
|
14
|
+
'MATCH ' + resolve(@parts, separator: ', ', payload: payload, context: context.add(self))
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -35,16 +35,17 @@ describe Cypher do
|
|
35
35
|
end
|
36
36
|
it 'executes the most complex query possible (exercises everything currently implemented)' do
|
37
37
|
c = Node('c', labels: 'what')
|
38
|
+
v = Node('v', labels: 'other')
|
38
39
|
n = Node('n')
|
39
40
|
r = Rel('r')
|
40
|
-
cypher_class = Cypher(Match(r.from(c).to(n)),
|
41
|
+
cypher_class = Cypher(Match(r.from(c).to(n), v),
|
41
42
|
Where(And(Eql(c.stuff, Param('thing')),
|
42
43
|
Like(c.staff, 'test%'))),
|
43
44
|
Return(c.name, Alias(c.stuff, 'something')),
|
44
45
|
OrderBy(c.name, :desc, c.stuff),
|
45
46
|
Limit(10))
|
46
47
|
cypher_class.new(adapter).execute(thing: 'of course')
|
47
|
-
expect(adapter).to have_received(:execute).with('MATCH (c:what)-[r]->(n) WHERE c.stuff = {thing} AND c.staff LIKE "test%" RETURN c.name AS name, c.stuff AS something ORDER BY c.name desc, c.stuff LIMIT 10', {thing: 'of course'})
|
48
|
+
expect(adapter).to have_received(:execute).with('MATCH (c:what)-[r]->(n), (v:other) WHERE c.stuff = {thing} AND c.staff LIKE "test%" RETURN c.name AS name, c.stuff AS something ORDER BY c.name desc, c.stuff LIMIT 10', {thing: 'of course'})
|
48
49
|
end
|
49
50
|
context 'with Opt' do
|
50
51
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cypher_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ronie Uliana
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|