web-sql

Developing a HTML5 offline storage solution for iOS/Android in 2011

独自空忆成欢 提交于 2019-12-02 13:55:39
The problem: I need a device agnostic (e.g. HTML5) solution for storing and querying 250,000+ rows of data offline on a phone or tablet type device (e.g. iOS/Android). The idea being I have people working in remote areas without any cellular data connection and they need to run queries on this data and edit it while offline. Partly it will be geo-location based so if there are assets in the area they are in (uses GPS) then it will show those assets and let them be edited. When they return to the office they can sync the data back to the office server. The reason that I'm approaching this from

websql drop column with javascript

不羁岁月 提交于 2019-12-02 13:30:22
问题 I'm trying to delete a column in a websql database with javascript. I have tried the following with no success: db.transaction( function(transaction) { transaction.executeSql('ALTER TABLE log_entries DROP COLUMN name;'); } ); where, name is the column I want to delete from the table log_entries. Could someone please advise me how I would go about deleting a column in a websql database with javascript? 回答1: In the Web SQL is not implemented removing fields. I'm currently working on this

Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

。_饼干妹妹 提交于 2019-12-02 06:24:45
问题 I have a webapp that I'm building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and enter data into the fields. Now I'm trying to read the data back out with a SELECT statement, to show it on screen and as a list of the columns. I just don't know the syntax for the SELECT statemnt in javascript or HTML5 beyond 'SELECT * FROM MyTable'...I know it can be done, just need some help with the syntax of

websql drop column with javascript

六月ゝ 毕业季﹏ 提交于 2019-12-02 05:49:17
I'm trying to delete a column in a websql database with javascript. I have tried the following with no success: db.transaction( function(transaction) { transaction.executeSql('ALTER TABLE log_entries DROP COLUMN name;'); } ); where, name is the column I want to delete from the table log_entries. Could someone please advise me how I would go about deleting a column in a websql database with javascript? In the Web SQL is not implemented removing fields. I'm currently working on this problem. One of way - data dump and remove the table. Then restore the table with the new fields. Restore the data

Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

ε祈祈猫儿з 提交于 2019-12-02 01:28:22
I have a webapp that I'm building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and enter data into the fields. Now I'm trying to read the data back out with a SELECT statement, to show it on screen and as a list of the columns. I just don't know the syntax for the SELECT statemnt in javascript or HTML5 beyond 'SELECT * FROM MyTable'...I know it can be done, just need some help with the syntax of getting the results onto the screen. I start with this. var db = window.openDatabase('TabOrder', '', 'Bar

Chrome Version 75.0.3770.80 (Official Build) (64-bit) - unable to begin transaction (3850 disk I/O error)

左心房为你撑大大i 提交于 2019-12-01 10:55:55
In windows 7 chrome latestVersion 75.0.3770.80 (Official Build) (64-bit) got an error while get data and write data to chrome browser db in web sql. "unable to begin transaction (3850 disk I/O error)". Do you know any solution to this issue? This issue happens if you edit (insert/replace/update) the same data to the same table at the same time. One of the possible cases is you're having 2 tabs opened that access the same database. This is chrome regression since it was working before v75. Possible solutions are: You could either wait until it gets fixed in chrome. You could implement a manual

WebSQL: Are returned rows in SQLResultSetRowList immutable?

冷暖自知 提交于 2019-12-01 06:46:04
I've been fetching rows from a WebSQL DB, and the returned rows seems to be readonly. db.readTransaction( function(t1) { t1.executeSql( "SELECT * FROM Foo WHERE id = ?", [1], function(t2, resultSet){ var foo = resultSet.rows.item(0); console.log("before: " + foo.col1); foo.col1 = "new value"; console.log("after: " + foo.col1); console.log("sealed? " + Object.isSealed(foo)); console.log("frozen? " + Object.isFrozen(foo)); } ); } ); It prints: before: old value after: old value sealed? false frozen? false I had to manually clone the row to be able to modify it. How is this possible? How can an

Prevent SQL injection in WebSQL database? (How to handle quotes in data?)

本小妞迷上赌 提交于 2019-11-30 17:20:21
问题 I'm currently importing an xml export of a mysql database into a websql database for use in an online mobile experience. Everything works fine and dandy until there are double quotes in whatever string I am inserting. Normally, in PHP I would be using something like: mysql_real_escape_string while inserting. Options I know I can try is to write regex and make functions for adding/removing slashes. There are lots of examples on google for this - but what i'm looking to see is if anyone else

Phonegap. What happens to web SQL database on app update?

半腔热情 提交于 2019-11-30 09:25:11
问题 Please excuse the very novice question but I am about to embark on my first mobile app project using Phonegap. My project will rely heavily on a web SQL database. When I make updates to the app in the future, I need the database the user has built up to remain intact. I would assume the database is contained within the app package, When they update, what happens to the database? is it completely reset with the new app? (I've spent quite sometime googling this but have not found an answer to

IndexedDB Performance and IndexedDB v/s WebSQL performance comparison

為{幸葍}努か 提交于 2019-11-30 07:20:58
WebSQL and IndexedDB are both DB API for accessing (CRUD) the underlying embedded database in the web browser. Which, if I am correct, is like SQL for accessing (CRUD) any client-server database like Oracle etc. (in many case support for both WebSQL and IndexedDB is available on same browser) So, does it mean that both WebSQL and IndexedDB are accessing (CRUD) the same underlying embedded database and if that it the case then it will have same performance on all web browsers! But I think that is not the case, so does it mean that a web browser will have more than one underlying embedded