人类可读的好方法人类维护的数据库

发布于 2024-08-05 07:32:24 字数 308 浏览 4 评论 0原文

场景如下:

  • 您有一堆数据需要以 SQL 形式结束。
  • 需要手动输入。
  • 这不是一个“输入一次就完成了”的场景:它需要人类以持续迭代的方式进行修改和扩展。评论将与条目相关联。对于数据输入人员来说,能够查看彼此相邻的相关条目也很有用。
  • 数据的不同部分需要由不同的人同时处理。
  • 还需要进行一些错误检查。 (让数据输入人员在 SQL 发现错误之前纠正错误)

我有一个答案,这就是我的项目当前的运作方式,但我突然想到,也许还有其他很棒的方法可以做到这一点,而且不会出现问题我目前的方法。

So this is the scenario:

  • You have a bunch of data that needs to end up in SQL.
  • It needs to entered by hand.
  • It is not an "enter once and you're done" scenario: it will need to be modified and expanded by humans in an ongoing iterative way. Comments will be associated with entries. It is also useful for data entry people to be able to see related entries near each other.
  • Different parts of data will need to be worked on simultaneously by different people.
  • Some error checking also needs to happen. (Let the data entry people correct their mistakes before SQL picks them up)

I have one answer, which is how my project currently operates, but it occurred to me that maybe there are other awesome ways of doing this which don't have the problems of my current method.

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

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

发布评论

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

评论(4

作妖 2024-08-12 07:32:24

YAML 视为将数据表示为纯文本、人类可读且可修复文本的方式。

一个非常简单的程序可以解析 YAML、定位错误并(如果没有错误)更新数据库。

Look at YAML as a way to represent the data as plain, human-readable, and human-fixable text.

A very simple program can parse the YAML, locate errors and (if there are no errors) update the database.

小…红帽 2024-08-12 07:32:24

这些是一些非常基本的要求,您可能遇到的问题比所述的更多。尽管如此,您需要一个简单的管理实用程序来将数据输入数据库。

直接的 SQL 查询/更新实用程序并不能解决这个问题,因为您的团队需要验证等。您需要在事务支持下多用户访问相同的数据。您还希望注释您的数据条目并允许其他用户查看“相关条目”。

您需要一个数据库维护应用程序。

考虑使用 Django 之类的东西,它是内置的管理实用程序。这可能超出您的预期,但我想您未来的需求比您在这里所说的更多。

These are some really basic requirements, and you probably have more issues than those stated. Nonetheless, you need a simple admin utility to enter data into your database.

A straight SQL query/update utility doesn't cut it because your team needs validation and such. You need multi-user access to the same data with transactional support. You also want to annotate your data entries and allow "related entries" to be viewed by your other users.

You need a database-maintenance application.

Consider using something like Django and it's built admin utilities. It might be more than you're expecting, but I imagine you have more needs in your future than what you've stated here.

逆夏时光 2024-08-12 07:32:24

我的答案基本上是

  • 在 Prolog 文件中进行数据输入(Prolog 事实
  • 有多个文件,以对数据而言合理的方式进行分割。
  • 有一个将 Prolog 事实转换为 SQL 的脚本。
  • 在 Prolog 中进行一些测试来验证 Prolog 事实。

这种方法的缺点:

  • 有点烦人,必须检查多个文件以查看条目是否已存在或已被移动等。
  • 编写 Prolog 就这么简单,对于非程序员来说非常可怕(相比之下) 、填写 Excel 电子表格或一些指导流程)
  • 可能:合并很棘手,或者我的 VCS 不太智能(请参阅 哪个 SCM/VCS 可以很好地处理文件之间移动文本?

所以这工作得很好,但也许有更好的东西我已经从来没想过!

My answer is basically

  • Have the data entry work in Prolog files (Prolog facts)
  • Have multiple files, split up in a way that is sane for the data.
  • Have a script that converts the Prolog facts to SQL.
  • Have some tests in Prolog that validate the Prolog facts.

CONS of this approach:

  • a little bit annoying to have to check across multiple files to see if an entry already exists, or has been moved etc.
  • Writing Prolog, as simple as this is, is pretty scary for non-programmers (compared to say, filling out an Excel spreadsheet, or some guided process)
  • maybe: Merging is tricky, or maybe my VCS is just not very smart (see Which SCM/VCS cope well with moving text between files?)

So this works pretty well, but maybe there is something better that I've never thought of!

滿滿的愛 2024-08-12 07:32:24

如果您所指的约束可以在数据库级别强制执行,那么像 Quest Toad 这样的免费软件可以允许他们直接将数据输入数据库。感觉非常像在网格视图中使用电子表格,并且在违反约束时显示错误。

或者,根据您现有的可用堆栈,.Net 网格视图可以轻松地在短时间内将粗略的屏幕拼凑在一起。

If the constraints you're referring to can be enforced at the database level, free software like Quest Toad could allow them enter data directly into the db. It feels very much like using a spreadsheet when in grid view and displays an error when constraints are violated.

Alternatively, depending on what existing stack you have available, .Net grid views make it easy to slap together crud screens in little time.

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