Registry /
storage / redux-persist-sqlite-storage
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SQLiteStorage (default export)
✓ import SQLiteStorage from 'redux-persist-sqlite-storage'
✗ import { SQLiteStorage } from 'redux-persist-sqlite-storage'
The package exports a factory function as default export; named import will fail.
SQLiteStorage (CommonJS require)
✓ const SQLiteStorage = require('redux-persist-sqlite-storage').default
✗ const SQLiteStorage = require('redux-persist-sqlite-storage')
When using CommonJS, .default is required because the package uses ES module export.
Calling the factory
✓ const storeEngine = SQLiteStorage(SQLite, { name: 'my-db', location: 'default' })
✗ const storeEngine = SQLiteStorage(SQLite)
Second argument (config object) is optional, but omitting it uses defaults. Must pass react-native-sqlite-storage's SQLite object.
Sets up redux-persist with SQLite storage using react-native-sqlite-storage. Shows configuration and integration.
import SQLite from 'react-native-sqlite-storage';
import SQLiteStorage from 'redux-persist-sqlite-storage';
import { persistStore, persistReducer } from 'redux-persist';
import { createStore } from 'redux';
const config = { name: 'myReduxDB', location: 'default' };
const storeEngine = SQLiteStorage(SQLite, config);
const persistConfig = {
key: 'root',
storage: storeEngine
};
const rootReducer = (state = { count: 0 }, action) => {
switch (action.type) {
case 'INCREMENT': return { ...state, count: state.count + 1 };
default: return state;
}
};
const persistedReducer = persistReducer(persistConfig, rootReducer);
const store = createStore(persistedReducer);
const persistor = persistStore(store);
export { store, persistor };
Errors
Common errors & fixes
TypeError: _reduxPersistSqliteStorage2.default is not a function
Using CommonJS require without .default; package uses ES module export.
fixUse require('redux-persist-sqlite-storage').default SQLiteStorage is not a function
Named import used instead of default import.
fixUse import SQLiteStorage from 'redux-persist-sqlite-storage'
Cannot read property 'getItem' of undefined
Missing or incorrect SQLite instance passed to factory.
fixEnsure you import SQLite from 'react-native-sqlite-storage' and pass it correctly.
Audit
Dependencies
react-native-sqlite-storagerequiredRequired peer dependency; the adaptor wraps its SQLite instance.
redux-persistrequiredRequired to integrate with the redux-persist ecosystem.