Skip to main content

Questions tagged [indexeddb]

indexedDB provides a way to store data in the browser using Javascript. Unlike relational databases, indexedDB uses a key-value store that is conceptually similar to HTML5's local storage. However, indexedDB is better than local storage for storing large amounts of data and for querying data more quickly. indexedDB is supported in IE, Chrome, Firefox, and Microsoft Edge, although support for specific features varies.

Filter by
Sorted by
Tagged with
135 votes
4 answers
52k views

How is indexedDB conceptually different from HTML5 local storage?

Both indexedDB and local storage are key value stores. What is the advantage of having two key/value stores? indexedDB is asynchronous, but joins (the most time-consuming thing) are manual. They ...
Samuel Danielson's user avatar
112 votes
4 answers
40k views

Storing Image Data for offline web application (client-side storage database)

I have an offline web application using appcaching. I need to provide it about 10MB - 20MB of data that it will save (client-side) consisting mainly of PNG image files. The operation is as follows: ...
Dr.YSG's user avatar
  • 7,459
104 votes
20 answers
135k views

How to delete indexedDB?

I'm working in a project which involves using IndexedDB. As I'm begining to know this technology, I need to be able to delete an indexedDB by hand so I can start over. I found the way to do it in ...
PaquitoSoft's user avatar
  • 3,337
95 votes
3 answers
102k views

Maximum item size in IndexedDB

I'm working on a simple web utility that makes use of IndexedDB (similar to a key-value DB) feature of HTML5. I was looking for but I was unable to know: what is the maximum size I can store in an ...
acanimal's user avatar
  • 4,950
74 votes
7 answers
15k views

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

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 ...
zuallauz's user avatar
  • 4,318
57 votes
2 answers
63k views

How can I remove a whole IndexedDB database from JavaScript? [duplicate]

How can one remove a whole IndexedDB database from JavaScript, as opposed to just an object store? I'm using the IndexedDB shim, which may use WebSQL as its backend. I'd mainly like to know how to do ...
aknuds1's user avatar
  • 67.4k
56 votes
3 answers
36k views

How to access Google Chrome's IndexedDB/LevelDB files?

I want to use Google Chrome's IndexedDB to persist data on the client-side. Idea is to access the IndexedDB outside of chrome, via Node.JS, later on. The background is the idea to track usage ...
Chris's user avatar
  • 2,334
50 votes
10 answers
33k views

React-native bundling failure. ERROR MESSAGE: "While trying to resolve module 'idb'..... Indeed none of these files exist":

ERROR MESSAGE IN QUESTION: While trying to resolve module idb from file C:\Users\OG\Desktop\programming\react_native\mealstogo\MealsToGo2\node_modules\@firebase\app\dist\esm\index.esm2017.js, the ...
JohnyClash's user avatar
46 votes
6 answers
54k views

HTML5 IndexedDB, Web SQL Database and browser wars

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 ...
ivo's user avatar
  • 4,191
45 votes
4 answers
21k views

In IndexedDB, is there a way to make a sorted compound query?

Say a table has, name, ID, age, sex, education, etc. ID is the key and the table is also indexed for name, age and sex. I need all male students, older than 25, sorted by their names. This is easy in ...
jason's user avatar
  • 3,492
43 votes
2 answers
27k views

When should I use Web SQL versus IndexedDB? [closed]

Recently, I have come across the Web SQL and IndexedDB APIs that are provided by browsers. What are the use cases for Web SQL and IndexedDB and when should I use one over the other?
Utsav Sinha's user avatar
42 votes
1 answer
34k views

Best IndexedDB Wrappers [closed]

I am just exploring various options for IndexedDB Wrapper and i've come across quite a few options as follows: YDN JQuery IndexedDb Plugin IDB Wrapper DB.js But I am unable to find out which one of ...
rh979's user avatar
  • 667
41 votes
6 answers
70k views

Storage limits on Chrome browser

What is the soft limit (at which the user needs to give permission to exceed)? What is the hard limit (maximum allowed).
Clay Nichols's user avatar
  • 12.1k
40 votes
4 answers
27k views

Persistence lifetime

I read few articles about IndexdDB, but couldn't find details about the lifetime of persisted data. I plan to use it for a session of data manipulation and upload once the user finishes. But what will ...
bsr's user avatar
  • 58.3k
38 votes
1 answer
10k views

Conceptual problems with IndexedDB (relationships etc.)

I'm writing a thesis about offline abilities of web applications. My task is to show the possibilities of offline storage through a web application with a server-side relational database and Ajax/JSON ...
Felix's user avatar
  • 779
37 votes
5 answers
44k views

Query using multiple conditions [duplicate]

I recently discovered (sadly) that WebSQL is no longer being supported for HTML5 and that IndexedDB will be replacing it instead. I'm wondering if there is any way to query or search through the ...
jthereliable's user avatar
36 votes
10 answers
36k views

Check if IndexedDB database exists

Is there a way to check if an IndexedDB database already exists? When a program tries to open a database that does not exists the database is created. The only way that I can think of is something ...
Pedro Almeida's user avatar
36 votes
1 answer
10k views

What is the difference between add and put in indexeddb?

I am just starting to use indexeddb and transforming Web SQL. I tried to use add and put to add some data in data store. I could not really see what is/are the difference/s of using these two ...
amol01's user avatar
  • 1,853
32 votes
2 answers
38k views

Failed to execute 'createObjectStore' on 'IDBDatabase'

why do I have a error ? My code: var idb = window.indexedDB || // Use the standard DB API window.mozIndexedDB || // Or Firefox's early version of it window.webkitIndexedDB;...
Michael Phelps's user avatar
32 votes
2 answers
3k views

How can I make a really long string using IndexedDB without crashing the browser?

I'm writing a web app that generates a potentially large text file that the user will download, and all the processing is done in the browser. So far I'm able to read a file over 1 GB in small chunks, ...
Matt's user avatar
  • 23.3k
31 votes
8 answers
44k views

Offline access - SQLite or Indexed DB?

I am in the R&D phase of developing an application, with the following key requirements: HTML5 web application - which will also have a hybrid version Forms data will be stored locally, when no ...
Taha's user avatar
  • 1,086
30 votes
2 answers
24k views

Using IndexedDB to save images

<img src="picture_1.png" id="imgHolder"/> Would like to save image with indexedDB in database named Images on button click. <button id="write" onclick="saveToDB()">Save To DB</button&...
Vishnu G S's user avatar
30 votes
2 answers
4k views

Primary Key issue on iOS8 implementation of IndexedDb

The issue is when you have two different object stores in the same indexeddb, primary key values appear to be "shared" across all stores. <body> <script type="text/javascript"> ...
Jonathan Smith's user avatar
29 votes
2 answers
10k views

How to create an indexeddb composite key

I spent hours and hours searching for this one, and just by trial and error was I able to finally find the solution. Logging this in Stack Overflow for future searchers. Q: How do I create a ...
SnareChops's user avatar
  • 13.3k
28 votes
3 answers
14k views

Get notified when indexedDB entry gets changed in other tab

If a user opens multiple instances of a web app in multiple tabs, any instance can be notified of changes to localStorage that any other instance makes by registering a storage event listener. A tab ...
Thomas W's user avatar
  • 15.2k
28 votes
3 answers
11k views

IndexedDB Fuzzy Search

Ok, first of all, sorry for my English. I'm working in a web project that show suggests when I type something in the inputbox, but I want to use IndexedDB to improve the query speed in Firefox. With ...
Fong-Wan Chau's user avatar
28 votes
2 answers
25k views

Do modern browsers encrypt or otherwise protect IndexedDB storage?

My team is considering using IndexedDB to cache data across user sessions. This data can be large enough that it would be a real performance boost to be able to keep it around in the browser for later ...
Jason Jackson's user avatar
27 votes
4 answers
22k views

IndexedDB view all Databases and Object Stores

I'm using IndexedDB in a Windows 8 app and I'm very new to both. I've been able to successfully create, read, update, delete objects from object stores, and have created a couple databases and a few ...
skinneejoe's user avatar
  • 3,981
27 votes
7 answers
29k views

How to view IndexedDB content in firefox

I've been playing with IndexedDB in Firefox (Ubuntu) Is there any way to visualize IndexedDB databases contents ? Or do I have to do it programmatic-ally ?
Fernando Fabreti's user avatar
27 votes
1 answer
21k views

Javascript: Searching indexeddb using multiple indexes

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@[email protected]' SELECT * FROM customers ...
Jeanluca Scaljeri's user avatar
25 votes
4 answers
25k views

Uncaught InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running

i must admit that i am very new to indexedDB I wrote a simple code of indexedDB and it is as followed: function go() { var req = window.indexedDB.open("Uploader", 1), db; req....
anni saini's user avatar
24 votes
1 answer
10k views

Detecting Available Storage with IndexedDB

I have written an offline application that utilises IDB to store images and text that would normally exist in a MySQL DB for offline use. However, I am trying to figure out a way that I can read the ...
Jayden Spring's user avatar
24 votes
2 answers
14k views

IndexedDB: Store file as File or Blob or ArrayBuffer. What is the best option?

Now most of browsers are supporting IndexedDB to store data/file directly as File, Blob or ArrayBuffer. This code saves a IDB key 'File1' as File <input type="file" id="userfile" /> var a = ...
Ankit_Shah55's user avatar
23 votes
3 answers
30k views

How to make offline maps(using leaflet OSM) , by caching?

I am trying to make offline maps through caching (IndexedDB) in browser. I understand the concept is that I download and store the tiles of map first when connected to internet. Then I have to load ...
Abhi Ram A's user avatar
22 votes
3 answers
8k views

Why does indexedDB use a "version"?

I'm just learning about indexedDB, and this is my understanding of setting up a database. You call .open(dbName) to get a DB instance. If no database of this name exists on the user's computer (for ...
Jack M's user avatar
  • 5,423
22 votes
1 answer
27k views

Preventing UI flicker when loading async data in React.js

I have some data in IndexedDB, which can only be accessed asynchronously. I want to build a React.js UI using that data. The general idea is that I'll have multiple React components that load data ...
dumbmatter's user avatar
  • 9,553
21 votes
4 answers
12k views

How do you keep an indexeddb transaction alive?

Instead of opening several transactions (read a table, write to a table, write to another table, etc) is it possible to do this all from a single transaction as long as you are using an appropriate ...
anonymous's user avatar
  • 1,279
21 votes
5 answers
15k views

Inserting large quantities in IndexedDB's objectstore blocks UI

I want to save some ~35000 objects in my IndexedDB's objectstore. I am using below code to insert. AddListings = function (x2j_list_new, callback) { var transaction = db.transaction(["listings"...
surya's user avatar
  • 1,349
21 votes
3 answers
17k views

Deleting multiple records in IndexedDB based on index

I am using IndexedDB and I have two object stores: equip (represents different equipment, primary key tagNo) and equipParts (represents the parts of a piece of equipment and has an index which is ...
user2727708's user avatar
21 votes
4 answers
7k views

Synchronizing MongoDB server data to an IndexedDB local store

I'm trying to evaluate using IndexedDB to solve the offline issue. It would be populated with data currently stored in a MongoDB database (as is). Once data is stored in IndexedDB, it may be changed ...
Philippe Girolami's user avatar
20 votes
2 answers
12k views

Using IndexedDB asynchronously

Loading data and store them in indexeddb database. Periodically I have the database crashes and lost access to it. Give me, please, a solution how use indexeddb asynchronously! Sample code that I'm ...
Greg's user avatar
  • 301
20 votes
5 answers
5k views

IndexedDB - boolean index

Is it possible to create an index on a Boolean type field? Lets say the schema of the records I want to store is: { id:1, name:"Kris", _dirty:true } I created normal not unique index (...
g00fy's user avatar
  • 4,737
20 votes
1 answer
13k views

When and why is the onupgradeneeded method called in indexedDB?

I'm using IndexedDB for a test project. Here is some example code: var indexedDB = window.indexedDB || window.webkitIndexedDB ||window.mozIndexedDB||window.msIndexedDB; var ...
Johan's user avatar
  • 35.4k
20 votes
1 answer
4k views

Locking model for IndexedDB?

How does IndexedDB handle multiple tabs each with asynchronous transactions in-flight? Do transactions lock all of the related object stores entirely? How can I guarantee that if one tab is working on ...
Ben Dilts's user avatar
  • 10.7k
20 votes
3 answers
23k views

Exporting and importing IndexedDB data

I'm making a tool for my own use that needs a simple database. This seems like a good chance to learn the HTML5 IndexedDB API, but it's important that I don't lose data at any point. I suppose ...
JJJ's user avatar
  • 33.1k
20 votes
1 answer
5k views

Electron IndexedDb limit?

In this Electron issue, @zcbenz commented: We have the same size limitation with Chrome browser, which is '1/3 of the of available disk space'. That response was from early 2016. I've run this code: ...
TimTheEnchanter's user avatar
19 votes
3 answers
23k views

Sorting the results of an indexedDB query

I want to sort results obtained from indexedDB. Each record has structure {id, text, date} where 'id' is the keyPath. I want to sort the results by date. My current code is as below: var ...
vivek.m's user avatar
  • 3,311
19 votes
3 answers
20k views

Accessing indexedDB in ServiceWorker. Race condition

There aren't many examples demonstrating indexedDB in a ServiceWorker yet, but the ones I saw were all structured like this: const request = indexedDB.open( 'myDB', 1 ); var db; request....
Adria's user avatar
  • 8,871
19 votes
1 answer
11k views

Why IndexedDB is not available in node.js? [closed]

IndexedDB API on node.js will be very useful for some app. Why IndexedDB is not available in node.js? IndexedDB API does not depend on DOM, even though it does use some DOM error and event style.
Kyaw Tun's user avatar
  • 12.9k
19 votes
2 answers
12k views

Can I check how much space my indexedDB is taking up?

I'd like to get a breakdown of how much storage space a web app I'm working on is taking up. More specifically I'm interested in the size of data stored in indexedDB. I know I can use navigator....
user2145184's user avatar

1
2 3 4 5
48