人类可读的好方法人类维护的数据库
场景如下:
- 您有一堆数据需要以 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将 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.
这些是一些非常基本的要求,您可能遇到的问题比所述的更多。尽管如此,您需要一个简单的管理实用程序来将数据输入数据库。
直接的 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.
我的答案基本上是
这种方法的缺点:
所以这工作得很好,但也许有更好的东西我已经从来没想过!
My answer is basically
CONS of this approach:
So this works pretty well, but maybe there is something better that I've never thought of!
如果您所指的约束可以在数据库级别强制执行,那么像 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.