web-sql

Synchronous query to Web SQL Database

痞子三分冷 提交于 2019-11-28 09:54:51
I'm working on a bit of JavaScript that interacts with a client-side SQLite database, via the newish window.openDatabase(...) , database.transaction(...) and related APIs. As most of you know when you execute a query in this way it is an asynchronous call, which is typically good. You can make the call and handle the results as appropriate with callbacks. In my current situation I'm working on an algo for a client that does some hierarchy walking in the locally stored database. The part of the algo I'm having trouble with requires starting at some row, which has a reference to a "parent" (by

Javascript: Searching indexeddb using multiple indexes

人走茶凉 提交于 2019-11-28 07:34:30
I want to change from WebSql to Indexeddb. However, how would one do SQL queries like SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@bill@company.com' SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@bill@company.com' and age = 30 SELECT * FROM customers WHERE ssn = '444-44-4444' and emal = 'bill@bill@company.com' and name = 'Bill' etc with IndexedDB ? For example, I noticed while reading the documentation of indexedDb, that all the examples only query one index at the time. So you can do var index = objectStore.index("ssn"); index.get("444-44-4444")

HTML5 IndexedDB, Web SQL Database and browser wars

半世苍凉 提交于 2019-11-28 03:27:45
I'm starting the development of a web app with offline database storage requirements. Long story short, the app should be able to run on: One of the major desktop browsers, Chrome preferred Safari on iOS Android's native browser (based on V8 and WebKit) So the question is which technology to choose: IndexedDB or Web SQL Database? Regarding Web SQL Database, on one hand, it is ready to be used in any of the above scenarios. On the other, Mozilla has stated Firefox will never implement it, and acording to the HTML5 working draft the specification has reached an impasse: This specification has

Where is data stored when using an HTML 5 Web SQL Database

自古美人都是妖i 提交于 2019-11-27 19:32:31
I just read something about HTML 5 Web SQL Databases. I did a little search on here and Google but couldn't find a simple to the point answer. Can someone tell me, where is the data stored when using this? In memory or a text file or something else? Also what browsers support this? triangle_man It's stored in a SQLite database. Here is a browser support chart I found: . That said, the W3C has officially dropped support for WebSQL in favor of IndexedDB. Here's the equivalent chart for that: You may also want to look at DataJS , which is a library that abstracts some of the details of local

WebSQL for PhoneGap Application [closed]

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 15:56:50
I'm looking to use a WebSQL to store data in an Android PhoneGap app but dunno where to start. There is no need to retrieve data from the web as the application is offline, and I want to have a prepopulated database that can be queried. A few questions: How do you create a pre-populated database? (what kind of file format should it be) If there are two factors can be changed, how do I get the result of a combination of these factors from the database using SQL. Will the database be wiped if the user clears app data from the Settings menu on an Android device? Grateful for any help. thanks Ved

Local Storage, Session storage, Web storage, web database and cookies in HTML5

一个人想着一个人 提交于 2019-11-27 12:25:04
问题 What is the difference between these concepts, and when should I use one in particular? Does this listing also contain different names for the same general concept? HTML5 local storage HTML5 session storage HTML5 web storage HTML5 web database Cookies 回答1: HTML5 web storage is a generic umbrella term for the new client-side data storage options. Local Storage is persistent and scoped to the domain. At the moment two flavors are usually mentioned: 'default': stores things in name/value pairs

Web SQL Database + Javascript loop

安稳与你 提交于 2019-11-27 09:18:14
I'm trying to figure this out but can't seem to on my own... I'm playing with Web SQL DBs and I can't get a loop to work properly with it. I use: for (var i=0; i<=numberofArticles-1; i++){ db.transaction(function (tx) { tx.executeSql('INSERT INTO LOGS (articleID) VALUES (?)', [i]); }); }; And I get only 5's.. I don't get the incremental i values. Can anyone suggestion what I'm doing wrong and what I should be thinking about? It looks like the function is asynchronous, and that by the time tx.executeSql fires, the loop have finished looping and i has been changed several times. You can solve

Optimizing WebSQL Local Database Population

空扰寡人 提交于 2019-11-27 03:06:15
问题 I am trying to optimize the speed that my Local database populates in a Web app that is being developed. Currently, it uses PHP to access the Database and then inserts that data into the local database using Javascript. Problem is, anything more than a couple entries slows it down and I'm pretty sure it's because it executes an individual SQL query for EVERY row. I've been reading up on transactions (Commits and Rollbacks and what not) and it seems like an answer but I'm not entirely sure how

HTML5 IndexedDB, Web SQL Database and browser wars

僤鯓⒐⒋嵵緔 提交于 2019-11-27 00:04:04
问题 I'm starting the development of a web app with offline database storage requirements. Long story short, the app should be able to run on: One of the major desktop browsers, Chrome preferred Safari on iOS Android's native browser (based on V8 and WebKit) So the question is which technology to choose: IndexedDB or Web SQL Database? Regarding Web SQL Database, on one hand, it is ready to be used in any of the above scenarios. On the other, Mozilla has stated Firefox will never implement it, and

How permanent is local storage on Android and iOS?

你说的曾经没有我的故事 提交于 2019-11-26 18:24:35
When my app stores data locally on a phone, how permanent is that storage? I'll elaborate the exact situation: I'm building an app with jQueryMobile and Phonegap. It's essentially a browser app, but using Phonegap lets me package it and sell it in the app stores, among other advantages. Phonegap offers two ways of storage, both of which functions harmonize native functions of iOs, Android, Blackberry and some other OSs: localStorage (which is primitive key-value pairs), and a Web SQL database. Both localStorage and web SQL are forms of storage that belong to the browser. Having said that, I