indexeddbshim / indexeddbshim/IndexedDBShim
React-Native support
- Dominant language
- JavaScript
- Stars
- 979
- Forks
- 191
- Avg merge
- 55m
- Merged PRs (30d)
- 2
Description
I would like to use this library together with something like https://github.com/craftzdog/react-native-sqlite-2 (which provides a WebSQL compatible interface through SQLite) to get Indexeddb support on React-Native.
I was hopeing this would be easy and that something like the following should work:
```
import SQLite from 'react-native-sqlite-2';
import setGlobalVars from 'indexeddbshim';
let idb = {};
setGlobalVars(idb, { win: SQLite });
var { indexedDB, IDBKeyRange } = idb;
```
But this fails when trying to import indexeddbshim with the following error:

I think that maybe it is trying to do some fancy stuff because it might think it is running on Node. I passed the SQLite object as win in the config because it would not find openDatabase any other way.
What can I try to make this work?
Contributor guide
Research direction
The issue provides a React-Native/SQLite setup snippet and an import error screenshot, but names no repository file or test. Reproduce the import with react-native-sqlite-2 and the shown setGlobalVars configuration first; done means the library initializes and exposes indexedDB and IDBKeyRange in React Native.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native, sqlite
- Domain
- databases, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100