是否可以从JavaScript访问SQLite数据库? [英] Is it possible to access an SQLite database from JavaScript?
问题描述
我有一组HTML文件和一个SQLite数据库,我想从浏览器访问,使用file:// scheme。是否可以使用JavaScript访问数据库和创建查询(和表)?
实际上,答案是肯定的。以下是您可以执行此操作的示例: http://html5doctor.com/introducing-web-
$ b p>此处的更多信息 HTML5 IndexedDB,Web SQL数据库和浏览器大战 a>
PS:as @Christoph said Web SQL不再处于主动维护中,Web应用程序工作组不打算继续维护它,请查看此处 https://developer.mozilla.org/en-US/docs/IndexedDB 。
EDIT
正如@clentfort所说,您可以使用SQL.js通过客户端JavaScript访问SQLite数据库。 p>
I have a set of HTML files and a SQLite database, which I would like to access from the browser, using the file:// scheme. Is it possible to access the database and create queries (and tables) using JavaScript?
Actually the answer is yes. Here is an example how you can do this: http://html5doctor.com/introducing-web-sql-databases/
The bad thing is that it's with very limited support by the browsers.
More information here HTML5 IndexedDB, Web SQL Database and browser wars
PS: As @Christoph said Web SQL is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further so look here https://developer.mozilla.org/en-US/docs/IndexedDB.
EDIT
As @clentfort said, you can access SQLite database with client-side JavaScript by using SQL.js.
这篇关于是否可以从JavaScript访问SQLite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!