How to create an embedded Neo4j database in c#

1.1k views Asked by At

How do I create an embedded Neo4j database in c#? I want to perform queries on this embedded database for testing and then discard it. Currently i'm using neo4jclient for performing queries on the database running on my system(localhost) but want to do this on an embedded database. How do I go about this?

This feature is present in Java in the following way:

GraphDatabaseFactory graphDbFactory = new GraphDatabaseFactory();
GraphDatabaseService graphDb = graphDbFactory
      .newEmbeddedDatabase("data/dbName");

Looking for something along these lines in c#.

1

There are 1 answers

1
MicTech On

It's not possible to do that.

Neo4j is a Java application and you need JVM to run it.

What you can try is IKVM.NET to run Neo4j in the .NET VM and call those methods from C# code.

You mentioned you want to embedded db for integration testings. I suggest to start new instance of Neo4j as part of test run. Only for testing purposes.