Skip to content

Instantly share code, notes, and snippets.

@retrography
Last active August 29, 2015 14:08
Show Gist options
  • Save retrography/1295ba19d0caa73a5dfe to your computer and use it in GitHub Desktop.
Save retrography/1295ba19d0caa73a5dfe to your computer and use it in GitHub Desktop.
A Scriptella configuration file for exporting data directly from Neo4j into a MySQL database
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
<description>Scriptella ETL File Template.</description>
<!-- Connections with batch-loading configuration -->
<connection id="graph" driver="org.neo4j.jdbc.Driver"
url="jdbc:neo4j://graphserver:7474">
statement.fetchSize = 1000
</connection>
<connection id="project" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://sqlserver:3306/database" user="root" password="">
statement.batchSize = 1000
</connection>
<!-- ETL Queries and Scripts -->
<query connection-id="graph">
MATCH (p:Package)-[r1]-(f:File)-[r2]-(s:Snippet)
RETURN p.title AS package, f.name AS file, s.sha AS sha
ORDER BY p.title;
<script connection-id="project">
INSERT INTO test (package, file, sha)
VALUES (?package, ?file, ?sha);
</script>
</query>
</etl>
@retrography
Copy link
Author

Don't forget to put this xml file in Scriptella's bin directory and the JDBC driver files into lib directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment