如何在 C# 中创建嵌入式 Neo4j 数据库 [英] How to create an embedded Neo4j database in c#

查看:32
本文介绍了如何在 C# 中创建嵌入式 Neo4j 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 C# 中创建嵌入式 Neo4j 数据库?我想对这个嵌入式数据库执行查询以进行测试,然后将其丢弃.目前我正在使用 neo4jclient 对在我的系统(本地主机)上运行的数据库执行查询,但想在嵌入式数据库上执行此操作.我该怎么做?

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?

此功能在 Java 中以下列方式存在:

This feature is present in Java in the following way:

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

在 c# 中沿着这些方向寻找一些东西.

Looking for something along these lines in c#.

推荐答案

这是不可能的.

Neo4j 是一个 Java 应用程序,您需要 JVM 才能运行它.

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

您可以尝试IKVM.NET在.NET VM中运行Neo4j并调用这些方法来自 C# 代码.

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

您提到要嵌入数据库以进行集成测试.我建议启动 Neo4j 的新实例作为测试运行的一部分.仅用于测试目的.

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.

这篇关于如何在 C# 中创建嵌入式 Neo4j 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆