从远程 SQL Server 加载 SQLite 数据库?

发布于 2024-07-26 06:04:58 字数 222 浏览 8 评论 0原文

我在项目中使用 SQLite ADO.NET,以便可以使用内存数据库进行单元测试。 我想要我的真实数据库的副本,但它位于服务器上。 从我读到的内容来看,我似乎必须为 SQLite 连接字符串的数据源指定“:memory”。 我的问题是,我什至不知道是否可以将非 SQLite 数据库的远程数据库加载到内存中,或者如何做到这一点? 关于如何做到这一点有什么想法吗? 这不是一个很大的分贝——最多 5 兆。 感谢您的投入!

I'm using SQLite ADO.NET in my project so that I can unit test using an in-memory database. I want a copy of my real database but it is across the server. From what I've read, it looks like I have to specify ":memory" for the data source for the SQLite connection string. My problem is that I don't even know if it's possible to load a remote database into memory that is not a SQLite database, or how to do it? Any thoughts on how this could be done? It's not a large db--maybe 5 megs at most. Thanks for the input!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风蛊 2024-08-02 06:04:58

事实上,我发现这并不重要——我不能将 SQLite 与 ADO.NET 一起使用,因为我的查询都是 T-SQL。

Actually, figured out it doesn't matter--I can't use SQLite with ADO.NET because my queries are all T-SQL.

得不到的就毁灭 2024-08-02 06:04:58

您实际上并不需要内存数据库,您可以在您的计算机上使用 SQL Server Express PC,或单元测试虚拟机。

您可以在每次运行测试时覆盖数据库文件。

You don't really need an in-memory database, you can use SQL Server Express on your PC, or a unit-testing VM.

You could overwrite the database file each time you run the test.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文