webkit-sqlite アダプターで問題が発生しました。key
どういうわけか、整数ではなく文字列形式で保存します。Indexed-db は問題なく動作します。キーを文字列に変換しません。以下のコードを参照してください。
var ppl = Lawnchair({adapter: 'webkit-sqlite', name:'people', record:'person'}, function(people) {
// anon fn bound to the instance
this.save({key:1, id:1, a:1, name:'nino'}, function(obj){
console.log(obj);
});
// anon fn bound to the instance
this.save({key:'2', id:2, a:2, name:'paolo'}, function(obj){
console.log(obj);
});
// get all the keys
this.keys(function(keys) {
console.log('keys:', keys);
});
// get 1
this.get(1, function(key) {
console.log('key:', key);
});
// get '2'
this.get('2', function(key) {
console.log('key:', key);
});
// we can also clear the entire collection w/ nuke
this.nuke()
});
出力:
undefined
Object {key: 1, id: 1, a: 1, name: "nino"}
Object {key: "2", id: 2, a: 2, name: "paolo"}
keys: ["1.0", "2"]
key: undefined
key: Object {key: "2", id: 2, a: 2, name: "paolo"}
エラー:
keys: ["1.0", "2"]
それが想定されていることを参照してくださいkeys: [1, "2"]
誰もこれに対するパッチを持っていますか?
ありがとう。