Saravana
Saravana

Reputation: 40594

Does IndexedDB support SQL-like transactions?

I am trying to understand IndexedDB using the docs at MDN.

I'm still not clear if it supports SQL-like transactions with rollbacks.

Upvotes: 0

Views: 470

Answers (1)

Nikel Weis
Nikel Weis

Reputation: 724

Yes it does.

IndexedDB is built on a transactional database model. Everything you do in IndexedDB always happens in the context of a transaction. The IndexedDB API provides lots of objects that represent indexes, tables, cursors, and so on, but each of these is tied to a particular transaction. Thus, you cannot execute commands or open cursors outside of a transaction.

Further information there.

Source: https://developer.mozilla.org/en-US/docs/IndexedDB/Basic_Concepts_Behind_IndexedDB

Upvotes: 3

Related Questions