C++ 的 Rails 迁移

发布于 2024-08-02 01:51:32 字数 36 浏览 1 评论 0原文

是否有一个 C++ 工具至少与 Rails 迁移非常相似?

Is there a tool for C++ that is at least remotely similar to Rails migrations?

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

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

发布评论

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

评论(1

夏有森光若流苏 2024-08-09 01:51:32

我认为任何与 Rails 迁移“类似”的东西都将在某种程度上特定于 ORM 或其他框架 - 易用性来自于您从一个对象模型迁移到另一个对象模型这一事实。

由于 C++ 没有 ORM 或任何其他指定数据库模式的内置方式,因此我不明白如何存在“用于 C++”的模式迁移工具。 也许如果您指定您正在使用哪些工具,对于那些知道可用工具的人来说,这个问题会更引人注目。

如果您可以纯粹用数据库表来表达迁移,那么您可以使用独立于任何 ORM 的迁移工具。 但实际上你并不需要它在 C++ 中,因为它只是发出 SQL(或任何数据库)命令。 周围有很多工具(也许搜索“数据库模式迁移”),尽管我担心我在这方面基本上一无所知,并且无法推荐一个。 只要您有数据库适配器,您甚至可以使用 Rails...

I think anything "similar" to Rails migrations is going to be somewhat specific to an ORM or other framework - the ease of use comes from the fact that you migrate from one object model to another.

Since C++ doesn't have an ORM or any other built-in way of specifying a database schema, I don't see how there can be a schema migration tool "for C++". Perhaps if you specify what tools you're using, the question will be more eye-catching for those who know what's available.

If you can express your migration purely in terms of the database tables, then you could use a migration tool that's independent of any ORM. But then you wouldn't actually need it to be in C++, since it's just issuing SQL (or whatever database) commands. There are plenty of tools around (maybe search "database schema migration"), although I'm afraid I'm basically ignorant in this area, and can't recommend one. As long as you have an adaptor to your database, you could even use Rails...

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