我在 jayData 上遇到了这个问题:我尝试创建这个简单的数据库:
var x=$data.Entity.extend("Person",
{
ID: {type: "int", key:true, required: true},
Name: {type: "string", required: true}
});
$data.EntityContext.extend("PersonDatabase",
{
People: {type: $data.EntitySet, elementType: Person}
});
var DB1=new PersonDatabase({
provider: 'webSql',
databaseName:'DB1',
});
效果很好。但是当我简单地将数据库类型切换为 indexxedDb 时,它什么也没做。
var x=$data.Entity.extend("Person",
{
ID: {type: "int", key:true, required: true},
Name: {type: "string", required: true}
});
$data.EntityContext.extend("PersonDatabase",
{
People: {type: $data.EntitySet, elementType: Person}
});
var DB1=new PersonDatabase({
provider: 'indexedDb',
databaseName:'DB1',
version: 1
});
有任何想法吗?