admin管理员组文章数量:1402935
I'm trying to create an application that works on any mobile device, but doesn't require internet. I want to have an Sqlite database that I can query. I found a script, but it creates a WebSQL database in the browser. I want to query the flatfile. Is that even possible?
Here is my code:
function createDatabase() {
try{
if (window.openDatabase) {
var db;
var shortName = 'configurator.sqlite';
var version = '1.0';
var displayName = 'configurator';
var maxSize = 65335;
db = openDatabase(shortName, version, displayName, maxSize);
} else {
console.log('failure');
}
} catch(e) {
alert(e);
}
}
I'm trying to create an application that works on any mobile device, but doesn't require internet. I want to have an Sqlite database that I can query. I found a script, but it creates a WebSQL database in the browser. I want to query the flatfile. Is that even possible?
Here is my code:
function createDatabase() {
try{
if (window.openDatabase) {
var db;
var shortName = 'configurator.sqlite';
var version = '1.0';
var displayName = 'configurator';
var maxSize = 65335;
db = openDatabase(shortName, version, displayName, maxSize);
} else {
console.log('failure');
}
} catch(e) {
alert(e);
}
}
Share
Improve this question
asked Oct 15, 2012 at 19:59
sehummelsehummel
5,56825 gold badges92 silver badges141 bronze badges
3
- so you do or dont want to use WebSQL? – prodigitalson Commented Oct 15, 2012 at 20:05
- WebSQL has been deprecated. I want to use something else. Is Indexed DB my only choice? I want to work with the SQLite file. – sehummel Commented Oct 15, 2012 at 20:06
- 2 as you stated WebSQL, the implementation of SQLite in Web Browser, is deprecated, so if you really need to use that format i can only suggest to use this SQL.js – user757095 Commented Oct 15, 2012 at 20:18
2 Answers
Reset to default 2Yes, Its possible. Try the following links
- http://benpoole./weblog/201106222227
- https://gist.github./1041277
- https://www.tutorialspoint./html5/html5_web_sql.htm
- https://developer.apple./library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html
The question is asking for someone who can provide a tutorial to query a FlatFile DB and not a web db embedded within the browser. All your links are providing tutorial on Web DB which the question clearly highlights.
I think you should research SQL.JS on Github to get a solution to what you want. It is somewhat dependent on Node.js but you will achieve your goal just fine.
本文标签:
版权声明:本文标题:html - Is it possible to open an Sqlite database with Javascript and not using anything but HTML5? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744345081a2601708.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论