Search code examples
javascriptydn-db

YDN-DB executeSql didn't work properly on browser


I have a stack that using executeSql in ydn-db. When I use executeSql in ydn-db, I didn't get properly. Here my snippet. My cacheDB schema is;

var p = new promise.Promise();
cacheDb = new ydn.db.Storage(dbName,db_cache_schema);
cacheDb.executeSql("SELECT * FROM category_item WHERE ref_id = '"+categoryId+"' LIMIT   "+ limit + " OFFSET " +offset).then(function(items) {
     p.done(items);
}, function(e) {
     throw e;
});
return p;

Error is cacheDb.executeSql is not a function

My current browser is Firefox 34.0 and OS is Ubuntu (14.04) 64

Is that require to do something to use executeSql?


Solution

  • You have to use the library with sql module, such as ydn.db-is-sql.js, available in download page.