使用 Simple.Data 生成模式?

发布于 2024-12-14 10:43:16 字数 431 浏览 8 评论 0原文

有没有办法使用 Simple.Data 库执行数据库模式生成(类似于 Fluent NHibernate 的做法)?

如果没有,是否有办法通过 Simple.Data 库对数据库运行 DDL(数据定义语言)命令?

目前,在一些集成测试中,我正在动态创建一个 SQL CE 数据库,自动生成架构(通过 Fluent NHibernate),运行测试(通过 Simple.Data 访问数据库) >),然后在测试运行后删除数据库(用于清理)。

如果能够使用 Simple.Data 执行 DDL 并删除 Fluent NHibernate 依赖项,那就太好了。

Is there a way to perform database schema generation with the Simple.Data library (similar to how Fluent NHibernate does it)?

If not, is there a way to run DDL (Data Definition Language) commands against a database via the Simple.Data library?

Currently in some integration tests I am creating a SQL CE database on the fly, auto generating the schema (via Fluent NHibernate), running the tests (accessing the database via Simple.Data), then deleting the database after the tests run (for cleanup).

It would be nice to be able to perform the DDL stuff using Simple.Data and remove the Fluent NHibernate dependency.

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

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

发布评论

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

评论(1

骄傲 2024-12-21 10:43:16

我建议使用 Fluent Migrator 来构建数据库架构 (https://github.com/schambers/fluentmigrator/)。这就是 Simple.Data 迁移可能的样子,因此重新发明轮子似乎没有什么意义。

Simple.Data 0.10 将有一个新的 InMemory 适配器,它是无模式的,以减少测试摩擦。 11月底就会出来。

I recommend using Fluent Migrator for building DB schema (https://github.com/schambers/fluentmigrator/). It's what Simple.Data migrations would probably look like, so there seems little point reinventing the wheel.

Simple.Data 0.10 will have a new InMemory adapter which is schema-less, to reduce testing friction. Will be out by the end of November.

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