{"id":46208,"library":"redux-persist-sqlite-storage","title":"redux-persist-sqlite-storage","description":"A redux-persist storage adaptor backed by SQLite via react-native-sqlite-storage. Version 1.0.4, no active release cadence (last update 2019). Key differentiator: drop-in replacement for AsyncStorage in React Native, compatible with redux-persist 4.x and 5.x. Provides getItem, setItem, removeItem, getAllKeys, clear methods with Promise and callback support.","status":"maintenance","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/prsn/redux-persist-sqlite-storage","tags":["javascript"],"install":[{"cmd":"npm install redux-persist-sqlite-storage","lang":"bash","label":"npm"},{"cmd":"yarn add redux-persist-sqlite-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add redux-persist-sqlite-storage","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency; the adaptor wraps its SQLite instance.","package":"react-native-sqlite-storage","optional":false},{"reason":"Required to integrate with the redux-persist ecosystem.","package":"redux-persist","optional":false}],"imports":[{"note":"The package exports a factory function as default export; named import will fail.","wrong":"import { SQLiteStorage } from 'redux-persist-sqlite-storage'","symbol":"SQLiteStorage (default export)","correct":"import SQLiteStorage from 'redux-persist-sqlite-storage'"},{"note":"When using CommonJS, .default is required because the package uses ES module export.","wrong":"const SQLiteStorage = require('redux-persist-sqlite-storage')","symbol":"SQLiteStorage (CommonJS require)","correct":"const SQLiteStorage = require('redux-persist-sqlite-storage').default"},{"note":"Second argument (config object) is optional, but omitting it uses defaults. Must pass react-native-sqlite-storage's SQLite object.","wrong":"const storeEngine = SQLiteStorage(SQLite)","symbol":"Calling the factory","correct":"const storeEngine = SQLiteStorage(SQLite, { name: 'my-db', location: 'default' })"}],"quickstart":{"code":"import SQLite from 'react-native-sqlite-storage';\nimport SQLiteStorage from 'redux-persist-sqlite-storage';\nimport { persistStore, persistReducer } from 'redux-persist';\nimport { createStore } from 'redux';\n\nconst config = { name: 'myReduxDB', location: 'default' };\nconst storeEngine = SQLiteStorage(SQLite, config);\n\nconst persistConfig = {\n  key: 'root',\n  storage: storeEngine\n};\n\nconst rootReducer = (state = { count: 0 }, action) => {\n  switch (action.type) {\n    case 'INCREMENT': return { ...state, count: state.count + 1 };\n    default: return state;\n  }\n};\n\nconst persistedReducer = persistReducer(persistConfig, rootReducer);\nconst store = createStore(persistedReducer);\nconst persistor = persistStore(store);\n\nexport { store, persistor };","lang":"typescript","description":"Sets up redux-persist with SQLite storage using react-native-sqlite-storage. Shows configuration and integration."},"warnings":[{"fix":"Ensure you import SQLite from 'react-native-sqlite-storage' and pass it as first argument.","message":"The factory function must be called with SQLite instance from react-native-sqlite-storage; passing null or wrong object will cause runtime errors.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use redux-persist@5.9.1 or lower; or migrate to redux-persist@6 with a custom storage adaptor.","message":"Only compatible with redux-persist 4.x and 5.x. Version 6+ uses a different storage interface.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider alternatives like redux-persist-expo-file-system or custom AsyncStorage adaptor.","message":"The package is unmaintained since 2019 and may have unfixed bugs and compatibility issues with newer React Native versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always handle array results; check if (keys.length) before iterating.","message":"The getAllKeys method returns keys as string array; empty database returns empty array, not null.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.4':22 '2019':29 '4':46 '5':49 'activ':24 'adaptor':11 'asyncstorag':37 'back':12 'cadenc':26 'callback':61 'clear':56 'compat':41 'differenti':31 'drop':33 'drop-in':32 'getallkey':55 'getitem':52 'javascript':63 'key':30 'last':27 'method':57 'nativ':18,40 'persist':3,9,45 'promis':59 'provid':51 'react':17,39 'react-native-sqlite-storag':16 'redux':2,8,44 'redux-persist':7,43 'redux-persist-sqlite-storag':1 'releas':25 'removeitem':54 'replac':35 'setitem':53 'sqlite':4,14,19 'storag':5,10,20 'support':62 'updat':28 'version':21 'via':15 'x':47,50","created_at":"2026-06-07T12:58:48.852499+00:00","updated_at":"2026-06-07T12:58:48.852499+00:00","problems":[{"fix":"Use require('redux-persist-sqlite-storage').default","cause":"Using CommonJS require without .default; package uses ES module export.","error":"TypeError: _reduxPersistSqliteStorage2.default is not a function"},{"fix":"Use import SQLiteStorage from 'redux-persist-sqlite-storage'","cause":"Named import used instead of default import.","error":"SQLiteStorage is not a function"},{"fix":"Ensure you import SQLite from 'react-native-sqlite-storage' and pass it correctly.","cause":"Missing or incorrect SQLite instance passed to factory.","error":"Cannot read property 'getItem' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/prsn/redux-persist-sqlite-storage#readme","github":"https://github.com/prsn/redux-persist-sqlite-storage","docs":null,"changelog":null,"pypi":null,"npm":"redux-persist-sqlite-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}