有没有不需要我声明数据库模式,而是根据我使用实体的方式创建它的快速数据库原型(prototype)制作工具。
例如,假设一个空数据库(伪代码):
user1 = new User() // Creates the user table with a single id column
user1.firstName = "Allain" // alters the table to have a firstName column as varchar(255)
user2 = new User() // Reuses the table
user2.firstName = "Bob"
user2.lastName = "Loblaw" // Alters the table to have a last name column
由于在动态创建架构时可以做出逻辑假设,并且您始终可以通过使用数据库工具稍后对其进行调整来覆盖其选择。
此外,您可以通过以这种方式进行单元测试来生成您的模式。
显然这仅用于原型(prototype)制作。
那里有这样的东西吗?
最佳答案
Google's Application Engine像这样工作。当您下载该工具包时,您将获得用于测试的数据库引擎的本地副本。
关于database - 自适应数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32231/