如何为 google 表单等字段设计数据库?

How to design database for fields like google forms?

我想构建具有动态字段的表单和模型,例如 Google 表单。但是我不知道什么类型的 model.Fields 用于此任务。 我使用 Postgres,我在考虑 Hstore 或 ArrayField 之类的东西,但我不确定。

最好的解决方案是什么?

您的任务可用的解决方案很少:

如果您使用现代 PostgreSQL 版本 (9.3+),您应该使用 PostgreSQL JSON 字段,因为 JSON 支持不同的数据类型。