Sqlite db 方案到 Django 模型

发布于 2024-11-15 17:59:30 字数 684 浏览 5 评论 0原文

我正在尝试在 GAE 上启动并运行我的本地 sqlite 数据库。根据 这篇文章,没有让我直接获取本地数据库的方法。这就是为什么我想做这样的事情:

  1. 我使用以下命令在我的开发服务器上启动并运行 sqlite 数据库: http://code.google.com/p/gae-sqlite/
  2. 在本地,我将数据库方案转换为 django 模型,并将数据库迁移到 GAE 数据库。
  3. 我使用 Google 的方式将我的数据获取到盖埃。

我的问题来了。有没有一个项目可以直接将sqlite db方案直接转换为django模型?

如果没有,我想我将不得不编写一个代码生成器。

谢谢

I am trying to get my local sqlite db up and running on GAE. According to this post, there is no way for me to get my local db up there directly. That's why I would like to do something like this:

  1. I get the sqlite db up and running on my dev server with this: http://code.google.com/p/gae-sqlite/
  2. Locally, I translate the db scheme into django model and migrate the db into GAE db.
  3. I use google's way to get my data up to GAE.

So here comes my question. Is there any project that is able to directly translate sqlite db scheme into django model directly?

If not, I guess I will have to write up a code gen.

Thanks

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

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

发布评论

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

评论(1

指尖微凉心微凉 2024-11-22 17:59:30

gae-sqlite(现已被内置 sqlite 支持取代)旨在在 sqlite 上运行开发应用程序服务器后端,以提高速度并减少内存消耗。它不允许您在 App Engine 中导入或使用自己的 sqlite 架构。

您需要将数据转储到 CSV 文件,并使用 App Engine 批量加载器(您链接到的)将它们批量加载到 dev_appserver 和生产环境中。或者,可以直接从 sqlite 数据库批量加载,但这涉及更多内容,并且可能不值得付出努力。

gae-sqlite (now superceded by built-in sqlite support) is designed to run the development appserver backend on sqlite for speed and reduced memory consumption. It doesn't let you import or use your own sqlite schema in App Engine.

You need to dump your data to CSV files, and use the App Engine bulkloader (which you linked to) to bulkload them into the dev_appserver and production environments. Alternately, it is possible to bulkload direct from the sqlite database, but that's a lot more involved, and probably not worth the effort.

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