Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-15-2019 09:11 AM
Does anyone know if its possible to execute .cql or .cypher files programmatically in embedded java mode as sort of a "batch" operation? I have numerous queries in a .cql file that I'd like to use whenever I spin up a new database using something like transactions in java: https://neo4j.com/docs/java-reference/current/tutorials-java-embedded/#tutorials-cypher-java . All I see is you can manually type out the query as a parameter but I was hoping there was functionality to pass an entire file.
01-15-2019 06:35 PM
You can split the file by a Semicolon at the end of the line.
And then execute each of those parts with db.execute(statement)
java.util.Scanner works well for that, that's what I use in APOC's apoc.cypher.runFile
too.
All the sessions of the conference are now available online