Questions tagged [ydn-db]

Client-side javascript database library. Works which IndexedDB, WebDatabase (WebSQL) and WebStorage (localStorage).

Javascript database module for Indexeddb, WebDatabase (WebSQL) and WebStorage (localStorage) storage mechanisms supporting version migration, advanced query and transaction.

References:

97 questions
1
vote
1 answer

YDN-DB How to verify if a record exists?

I'm trying to verify if a specific record exist inside a table by a given ID. For example: var id = 23; db.count('products',id).done(function(count) { if(count>0){ db.get('products',id).done(function(r) { //Do something …
Crash Override
  • 411
  • 6
  • 17
1
vote
1 answer

Return local variable in one function to another

I'm building an offline HTML page using Angular and using ydn-db for offline storage. I have a database service like so, demoApp.SericeFactory.database = function database() { var database = { dataStore: null, admins: [], …
Bond
  • 184
  • 2
  • 9
1
vote
1 answer

YDN-DB with multiple deferred

Im trying to use multiple deferred with jquery $.when but so far no luck, this is my code: var req = $.when(db.count('items'),db.values('items'),db.get('config', 1)); req.done(function(count,r,config) { var currency = config.currency; if(count…
Crash Override
  • 411
  • 6
  • 17
1
vote
1 answer

How to retrieve a sorted list of objects in ydn-db?

Following an example from the docs here http://dev.yathit.com/ydn-db/getting-started.html, the first example under "Sorting". My code: var schema = { stores: [ { name: "authors", keyPath: "id", indexes: [ { keyPath:…
Andrew Magee
  • 6,506
  • 4
  • 35
  • 58
1
vote
1 answer

How to query without limiting the number of results returned?

It seems by default any query will only return up to 100 values. ie: db.values("mystore").done(function(myvalues) { // myvalues.length <= 100, regardless of how many items are in `mystore` }); The docs refer to the API being values(store_name,…
Andrew Magee
  • 6,506
  • 4
  • 35
  • 58
1
vote
1 answer

Define Multiple-Columns as PK in YDN-DB

When define a schema with ydn-db I can define a single column as PK with this code: var products = { name: 'products', keyPath: 'id_product', autoIncrement: true, indexes: [ {keyPath: 'id_product'}, {keyPath:…
Fernando
  • 99
  • 2
  • 9
0
votes
1 answer

Can ydn-db be used as a direct WebSQL polyfill

I am building a webkit-based browser and want to provide a polyfill for WebSQL. I found ydn-db but if I inject the polyfill into the webpage, will it just work automatically? Meaning, when WebSQL javascript APIs are called such as…
Moe Bazzi
  • 85
  • 3
0
votes
0 answers

Searching in YDN-DB as LIKE in SQL Query

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…
0
votes
0 answers

Want to use YDN-db database instead of Ajax with Select2

I want to use YDN-db with select2, i tried few options but unable to sort. So i want to use executeSql command as below APP.db.executeSql("SELECT * FROM products WHERE name like '%test%'").then(function(results) { //something } so i tried…
0
votes
1 answer

WebAPI2 - Cross Origin scripting issues

I'm trying to access my WebApi service in a framework called YDN-DB. It is a local storage type database. It allows you to load from a URL and I'm trying to do it using a Cross Origin call. This is the code that creates the XMLHttpRequest and makes…
MB34
  • 4,210
  • 12
  • 59
  • 110
0
votes
1 answer

How to Index child object properties and writing search queries in YDN DB from JSON file data

I have gone through many sites but couldn't able to find any solution. here is my question. I want to index the both child and parent properties from YDN DB. My Sample JSON data : "dataList":[ { "id":1, …
Mohankumar Rathinam
  • 623
  • 1
  • 11
  • 25
0
votes
0 answers

ydn.db valuesByIndex method support on windows universal

In my cordova application I was using ydn.db. Method values was working fine. Now replaced it with valuesByIndex, which now fails. Does anybody know if ydn.db valuesByIndex method id fully supported on windows phone 10?
0
votes
1 answer

YDN-DB - Delete DB then recreate and load when page is loaded/reloaded but not when refreshed

I'm converting some IndexedDB code to use YDN-DB and need some help in converting this. This code essentially deletes the DB if the page is loaded or reloaded but not when it is refreshed. How would I accomplish that using YDN-DB? var indexedDB =…
MB34
  • 4,210
  • 12
  • 59
  • 110
0
votes
1 answer

YDN: error with message InvalidStateError on Firefox ver 44

We have strange issue. Our application is using Ydn.js (JS code for using browser-internal database). On one Firefox, it works without error, but on the other Firefox, it gives error: Error: InvalidStateError: url:…
P.K.
  • 1,746
  • 6
  • 25
  • 62
0
votes
1 answer

YDN-DB key Generator TypeScript

I want to create a databease schema using the TypeScript. It's pretty simple, but I can't, or don't know how, there to define the key generator. In the User Guide, for example, such a code snippet(using JavaScript): var schema = { ... indexes: [ …
Stefan Babos
  • 296
  • 4
  • 9