使用 HTML 5 Web SQL 数据库时数据存储在哪里

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8348082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:47:04  来源:igfitidea点击:

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

htmlweb-sql

提问by JasonDavis

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.

我刚刚阅读了一些关于 HTML 5 Web SQL 数据库的内容。我在这里和谷歌上做了一些搜索,但找不到一个简单的答案。

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?

还有哪些浏览器支持这个?

回答by duality_

Web SQL locations by system for Google Chrome:

Google Chrome系统的 Web SQL 位置:

Windows Vista or 7

Windows Vista 或 7

\Users\_username_\AppData\Local\Google\Chrome\User Data\Default\databases

Windows XP

视窗 XP

\Documents and Settings\_username_\Local Settings\Application Data\Google\Chrome\User Data\Default\databases

Mac OS X

Mac OS X

~/Library/Application Support/Google/Chrome/Default/databases

Linux

Linux

~/.config/google-chrome/Default/databases

回答by triangle_man

It's stored in a SQLite database. Hereis a browser support chart I found: .

它存储在 SQLite 数据库中。是我找到的浏览器支持图表:.

That said, the W3C has officially dropped support for WebSQL in favor of IndexedDB. Here'sthe equivalent chart for that:

也就是说,W3C 已正式放弃对 WebSQL 的支持,转而支持 IndexedDB。这是等效的图表:

You may also want to look at DataJS, which is a library that abstracts some of the details of local storage and works across browsers:

您可能还想看看DataJS,这是一个抽象本地存储的一些细节并跨浏览器工作的库:

Hope that helps.

希望有帮助。

回答by Chris McFarland

Here is one browser example:

这是一个浏览器示例:

On Windows 7, Chrome stores Web SQL (aka SQLite) databases in:

在 Windows 7 上,Chrome 将 Web SQL(又名 SQLite)数据库存储在:

C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\databases

C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\databases

Each extension or website that uses Web SQL is given its own folder. Within each folder will be a numbered, extensionless file that is an SQLite database. You could open said file with SQLite Database Browseror any SQLite-supported application.

每个使用 Web SQL 的扩展程序或网站都有自己的文件夹。每个文件夹中都有一个带编号的无扩展名文件,它是一个 SQLite 数据库。您可以使用SQLite 数据库浏览器或任何 SQLite 支持的应用程序打开该文件。

回答by nlawson

And in case anyone is looking for IndexedDB:

如果有人正在寻找 IndexedDB:

On Mac OS X:

Mac OS X 上

Chrome

铬合金

  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.blob(Blobstorage)
  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.leveldb(everything else - just LevelDB)
  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.blobBlob存储)
  • ~/Library/Application\ Support/Google/Chrome/Default/IndexedDB/<site>.leveldb(其他一切 - 只是 LevelDB)

Firefox

火狐

  • ~/Library/Application Support/Firefox/Profiles/<profile>/storage/default/<site>/idb
  • ~/Library/Application Support/Firefox/Profiles/<profile>/storage/default/<site>/idb