cypher-dsl 0.1.0.alpha.3 → 0.1.0
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/CHANGELOG.md +12 -1
- data/README.md +1 -1
- data/lib/cypher_dsl/renderer/visitor.rb +12 -5
- data/lib/cypher_dsl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7cd03073fbe59b47c751c62cd953a3d4e53b009c29ba1c7c23cec907a5aa87ef
|
|
4
|
+
data.tar.gz: 164cea84a14542b0f348939a8b8bb47f893b618c36609fd37c8f135b473645f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9470dc5e3ec3a582d2fecd247400d638886fd27dde0cbef2e233008b50e6983444173ec9327d2a516d1f52b454f08be86760742dd90bb9049d2aa9051a830d9a
|
|
7
|
+
data.tar.gz: 1faac1c67fa30d867dcf28ec1afad98c4efd343ef665fec79a8c3a6b00c007e85b3a8e8b1f0b6f7a74683d0e2887d28480bd8f7b63108718c657054926c7ee32
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.0] - 2026-11-09
|
|
11
|
+
|
|
12
|
+
First stable release. The public API is the one activegraph builds on; from here on,
|
|
13
|
+
breaking changes bump the minor version until 1.0.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- A name projected by `WITH` is visible to that clause's own `WHERE`, so a pattern condition
|
|
18
|
+
keeps it: `WITH n AS m WHERE (m)-->()` no longer renders as `WHERE ()-->()` (#1).
|
|
19
|
+
|
|
10
20
|
## [0.1.0.alpha.3] - 2026-11-01
|
|
11
21
|
|
|
12
22
|
The release activegraph's `ActiveGraph::Core::Query` builds on.
|
|
@@ -92,7 +102,8 @@ collection, IssueRelatedIT, FunctionsIT).
|
|
|
92
102
|
- Renderer with dialects (Neo4j 4, 5, 5.23+), pretty printing, identifier escaping,
|
|
93
103
|
parameter collection (`Statement#catalog`).
|
|
94
104
|
|
|
95
|
-
[Unreleased]: https://github.com/neo4jrb/cypher-dsl/compare/v0.1.0
|
|
105
|
+
[Unreleased]: https://github.com/neo4jrb/cypher-dsl/compare/v0.1.0...HEAD
|
|
106
|
+
[0.1.0]: https://github.com/neo4jrb/cypher-dsl/compare/v0.1.0.alpha.3...v0.1.0
|
|
96
107
|
[0.1.0.alpha.3]: https://github.com/neo4jrb/cypher-dsl/compare/v0.1.0.alpha.2...v0.1.0.alpha.3
|
|
97
108
|
[0.1.0.alpha.2]: https://github.com/neo4jrb/cypher-dsl/compare/v0.1.0.alpha.1...v0.1.0.alpha.2
|
|
98
109
|
[0.1.0.alpha.1]: https://github.com/neo4jrb/cypher-dsl/releases/tag/v0.1.0.alpha.1
|
data/README.md
CHANGED
|
@@ -138,7 +138,7 @@ The flags are `entity_names`, `parameter_names`, `all_aliases`, `internal_aliase
|
|
|
138
138
|
Pre-releases are not picked up by a bare requirement, so name the version:
|
|
139
139
|
|
|
140
140
|
```ruby
|
|
141
|
-
gem 'cypher-dsl', '0.1.0
|
|
141
|
+
gem 'cypher-dsl', '0.1.0'
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
Requires Ruby 3.4 or newer.
|
|
@@ -111,7 +111,7 @@ module CypherDSL
|
|
|
111
111
|
case clause
|
|
112
112
|
when Clauses::Match then render_match(clause)
|
|
113
113
|
when Clauses::With then render_with(clause)
|
|
114
|
-
when Clauses::Return then render_projection('RETURN', clause
|
|
114
|
+
when Clauses::Return then render_projection('RETURN', clause)
|
|
115
115
|
when Clauses::RawReturn then clause.items.map { |item| render_projection_item(item) }.join(', ')
|
|
116
116
|
when Clauses::Create then "CREATE #{render_pattern_elements(clause.pattern_elements)}"
|
|
117
117
|
when Clauses::Merge then render_merge(clause)
|
|
@@ -305,9 +305,16 @@ module CypherDSL
|
|
|
305
305
|
|
|
306
306
|
# WITH ends a query part: only the names it projects stay in scope, so a
|
|
307
307
|
# node that is not carried over renders with its labels again afterwards.
|
|
308
|
+
# The projected names are already known to the clause's own WHERE, next to
|
|
309
|
+
# the names of the part it ends: `WITH n AS m WHERE (m)-->()`. A `*` keeps
|
|
310
|
+
# the whole current scope.
|
|
308
311
|
def render_with(clause)
|
|
309
|
-
|
|
310
|
-
|
|
312
|
+
projection = render_projection('WITH', clause)
|
|
313
|
+
exported = exported_names(clause.items)
|
|
314
|
+
exported.merge(@visited_names) if clause.items.include?(Asterisk::INSTANCE)
|
|
315
|
+
@visited_names.merge(exported)
|
|
316
|
+
rendered = "#{projection}#{render_where(clause.where)}"
|
|
317
|
+
@visited_names = exported
|
|
311
318
|
rendered
|
|
312
319
|
end
|
|
313
320
|
|
|
@@ -321,13 +328,13 @@ module CypherDSL
|
|
|
321
328
|
end.to_set
|
|
322
329
|
end
|
|
323
330
|
|
|
324
|
-
def render_projection(keyword, clause
|
|
331
|
+
def render_projection(keyword, clause)
|
|
325
332
|
items = clause.items.map { |item| render_projection_item(item) }.join(', ')
|
|
326
333
|
parts = ["#{keyword} #{'DISTINCT ' if clause.distinct}#{items}"]
|
|
327
334
|
parts << "ORDER BY #{clause.order.items.map { |item| render_sort_item(item) }.join(', ')}" if clause.order
|
|
328
335
|
parts << "SKIP #{render_expression(clause.skip)}" if clause.skip
|
|
329
336
|
parts << "LIMIT #{render_expression(clause.limit)}" if clause.limit
|
|
330
|
-
|
|
337
|
+
parts.join(' ')
|
|
331
338
|
end
|
|
332
339
|
|
|
333
340
|
# In RETURN/WITH an aliased expression is defined once (`expr AS alias`);
|
data/lib/cypher_dsl/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cypher-dsl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Heinrich Klobuczek
|
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
145
|
version: '0'
|
|
146
146
|
requirements: []
|
|
147
|
-
rubygems_version: 4.0.
|
|
147
|
+
rubygems_version: 4.0.20
|
|
148
148
|
specification_version: 4
|
|
149
149
|
summary: A Ruby DSL (builder) for the Cypher query language
|
|
150
150
|
test_files: []
|