0

I am using YDN-DB for my web POS, library using clone from following source:

https://raw.githubusercontent.com/yathit/ydn-db/master/jsc/ydn.db-dev.js

All is going well, incorporation with indexed db.

The only concern is, i want to use LIKE for my query as shows below, but it does not work and return sql parsing error, it looks LIKE does not work in YDN-DB, can you please advise any solution to achieve this?

APP.db.executeSql("SELECT * FROM products WHERE name LIKE '%test%' ").then(function(results) {
    console.log(results);
});

However following works good.

APP.db.executeSql("SELECT * FROM products WHERE name = 'test'").then(function(results) {
    console.log(results);
});

i have tried the other way aswell, but available operator only supports the start of string search, as shows below:

var q = APP.db.from( 'products' ).where('name', '^', 'New');
var limit = 10000;
var result = [];
q.list( limit ).done( function( objs ) {
  result = objs;
    console.log(result);
});

Can any of you please help me out to achieve the nieche.

0 Answers0