-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOID] Add apoc.cypher.runFile(s) procedures with READ mode version (#…
…3950) (#3980) * [NOID] Add apoc.cypher.runFile(s) procedures with READ mode version (#3950) * Add apoc.cypher.runFile(s) procedures with READ mode version * fixed CI tests * changes review: renamed runReadFile* to runFile*ReadOnly, added column fileName, updated CypherExtended.collectError method the collectError method had a message `error in file: fileName`, now is not needed since we have the column `fileName` * [NOID] fix compile errors and code formatting * [NOID] fix compile error and code formatting * [NOID] fix test errors and formatting
- Loading branch information
Showing
23 changed files
with
376 additions
and
58 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.../modules/ROOT/examples/generated-documentation/apoc.cypher.runFileReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
¦xref::overview/apoc.cypher/apoc.cypher.runFileReadOnly.adoc[apoc.cypher.runFileReadOnly icon:book[]] + | ||
|
||
`apoc.cypher.runFileReadOnly(file or url,[{timeout:10,parameters:{}}])` - runs each `READ` statement in the file, all semicolon separated | ||
¦label:procedure[] | ||
¦label:apoc-extended[] |
5 changes: 5 additions & 0 deletions
5
...modules/ROOT/examples/generated-documentation/apoc.cypher.runFilesReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
¦xref::overview/apoc.cypher/apoc.cypher.runFilesReadOnly.adoc[apoc.cypher.runFilesReadOnly icon:book[]] + | ||
|
||
`apoc.cypher.runFilesReadOnly([files or urls],[{timeout:10,parameters:{}}]))` - runs each `READ` statement in the files, all semicolon separated | ||
¦label:procedure[] | ||
¦label:apoc-extended[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...ciidoc/modules/ROOT/pages/overview/apoc.cypher/apoc.cypher.runFileReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
= apoc.cypher.runFileReadOnly | ||
:description: This section contains reference documentation for the apoc.cypher.runFileReadOnly procedure. | ||
|
||
label:procedure[] label:apoc-extended[] | ||
|
||
[.emphasis] | ||
apoc.cypher.runFileReadOnly(file or url,[{statistics:true,timeout:10,parameters:{}}]) - runs each `READ` statement in the file, all semicolon separated - currently no schema operations | ||
|
||
== Signature | ||
|
||
[source] | ||
---- | ||
apoc.cypher.runFileReadOnly(file :: STRING?, config = {} :: MAP?) :: (row :: INTEGER?, result :: MAP?, fileName :: STRING?) | ||
---- | ||
|
||
== Input parameters | ||
[.procedures, opts=header] | ||
|=== | ||
|Name|Type|Default | ||
|file|STRING?|null | ||
|config|MAP?|{} | ||
|=== | ||
|
||
== Config parameters | ||
include::partial$usage/config/apoc.cypher.runExtended.adoc[] | ||
|
||
== Output parameters | ||
[.procedures, opts=header] | ||
|=== | ||
|Name|Type | ||
|row|INTEGER? | ||
|result|MAP? | ||
|=== | ||
|
||
== Reading from a file | ||
include::../../import/includes/enableFileImport.adoc[] | ||
|
||
[[usage-apoc.cypher.runFileReadOnly]] | ||
== Usage Examples | ||
include::partial$usage/apoc.cypher.runFileReadOnly.adoc[] | ||
|
||
xref::cypher-execution/index.adoc[More documentation of apoc.cypher.runFileReadOnly,role=more information] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...iidoc/modules/ROOT/pages/overview/apoc.cypher/apoc.cypher.runFilesReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
= apoc.cypher.runFilesReadOnly | ||
:description: This section contains reference documentation for the apoc.cypher.runFilesReadOnly procedure. | ||
|
||
label:procedure[] label:apoc-extended[] | ||
|
||
[.emphasis] | ||
apoc.cypher.runFilesReadOnly([files or urls],[{timeout:10,parameters:{}}])) - runs each `READ` statement in the files, all semicolon separated | ||
|
||
== Signature | ||
|
||
[source] | ||
---- | ||
apoc.cypher.runFilesReadOnly(file :: LIST? OF STRING?, config = {} :: MAP?) :: (row :: INTEGER?, result :: MAP?, fileName :: STRING?) | ||
---- | ||
|
||
== Input parameters | ||
[.procedures, opts=header] | ||
|=== | ||
|Name|Type|Default | ||
|file|LIST? OF STRING?|null | ||
|config|MAP?|{} | ||
|=== | ||
|
||
== Config parameters | ||
include::partial$usage/config/apoc.cypher.runExtended.adoc[] | ||
|
||
== Output parameters | ||
[.procedures, opts=header] | ||
|=== | ||
|Name|Type | ||
|row|INTEGER? | ||
|result|MAP? | ||
|=== | ||
|
||
== Reading from a file | ||
include::../../import/includes/enableFileImport.adoc[] | ||
|
||
[[usage-apoc.cypher.runFilesReadOnly]] | ||
== Usage Examples | ||
include::partial$usage/apoc.cypher.runFilesReadOnly.adoc[] | ||
|
||
xref::cypher-execution/index.adoc[More documentation of apoc.cypher.runFilesReadOnly,role=more information] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
docs/asciidoc/modules/ROOT/partials/usage/apoc.cypher.runFileReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Given this dataset: | ||
|
||
[source, cypher] | ||
---- | ||
CREATE (:ReturnQuery {id:1}), (:ReturnQuery {id:2}), (:ReturnQuery {id:3}); | ||
CREATE (n:Other {id: 4}); | ||
---- | ||
|
||
and this file, located in `.$NEO4J_HOME/import`: | ||
|
||
.match.cypher | ||
[source, cypher] | ||
---- | ||
MATCH (n:ReturnQuery) RETURN n; | ||
MATCH (n:Other) RETURN n; | ||
---- | ||
|
||
we can run the Cypher commands in `match.cypher`, by running the following query: | ||
|
||
[source,cypher] | ||
---- | ||
CALL apoc.cypher.runFileReadOnly("match.cypher"); | ||
---- | ||
|
||
.Results | ||
[opts="header", cols="1,5"] | ||
|=== | ||
| row | fileName | result | ||
| 0 | match.cypher | {"n":{"identity":1,"labels":["ReturnQuery"],"properties":{"id":1},"elementId":"..."}} | ||
| 1 | match.cypher | {"n":{"identity":2,"labels":["ReturnQuery"],"properties":{"id":2},"elementId":"..."}} | ||
| 2 | match.cypher | {"n":{"identity":3,"labels":["ReturnQuery"],"properties":{"id":3},"elementId":"..."}} | ||
| 0 | match.cypher | {"n":{"identity":4,"labels":["Other"],"properties":{"id":4},"elementId":"..."}} | ||
|=== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
docs/asciidoc/modules/ROOT/partials/usage/apoc.cypher.runFilesReadOnly.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Given this dataset: | ||
|
||
[source, cypher] | ||
---- | ||
CREATE (:ReturnQuery {id:1}), (:ReturnQuery {id:2}), (:ReturnQuery {id:3}); | ||
CREATE (n:Other {id: 4}); | ||
CREATE (n:SecondFile {id: 5}); | ||
---- | ||
|
||
|
||
and the following files, located in `.$NEO4J_HOME/import`: | ||
|
||
.match_first.cypher | ||
[source, cypher] | ||
---- | ||
MATCH (n:ReturnQuery) RETURN n; | ||
MATCH (n:Other) RETURN n; | ||
---- | ||
|
||
.match_second.cypher | ||
[source, cypher] | ||
---- | ||
MATCH (n:SecondFile) RETURN n | ||
---- | ||
|
||
we can run the Cypher commands in `create.cypher` and `update.cypher`, by running the following query: | ||
|
||
[source,cypher] | ||
---- | ||
CALL apoc.cypher.runFilesReadOnly(["match_first.cypher", "match_second.cypher"]); | ||
---- | ||
|
||
.Results | ||
[opts="header", cols="1,1,5"] | ||
|=== | ||
| row | fileName | result | ||
| 0 | .match_first.cypher | {"n":{"identity":1,"labels":["ReturnQuery"],"properties":{"id":1},"elementId":"..."}} | ||
| 1 | .match_first.cypher | {"n":{"identity":2,"labels":["ReturnQuery"],"properties":{"id":2},"elementId":"..."}} | ||
| 2 | .match_first.cypher | {"n":{"identity":3,"labels":["ReturnQuery"],"properties":{"id":3},"elementId":"..."}} | ||
| 0 | .match_first.cypher | {"n":{"identity":4,"labels":["Other"],"properties":{"id":4},"elementId":"..."}} | ||
| 0 | .match_second.cypher| {"n":{"identity":5,"labels":["SecondFile"],"properties":{"id":5},"elementId":"..."}} | ||
|=== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.