{"id":46051,"library":"react-native-sqlite-mobx","title":"react-native-sqlite-mobx","description":"Utility library bridging SQLite and MobX for React Native apps. Current version 1.3.18, under active development (status: active). Provides SQLite promise-based API, MobX observable models with CRUD operations via SQLiteMobxModel, and a reactive SQLiteMobxFlatList component. Differentiates by tightly coupling MobX state management with SQLite persistence, reducing boilerplate. Requires react-native >=0.61 and react >=16.9.0.","status":"active","version":"1.3.18","language":"javascript","source_language":"en","source_url":"https://github.com/carlosroberto555/react-native-sqlite-mobx","tags":["javascript","typescript"],"install":[{"cmd":"npm install react-native-sqlite-mobx","lang":"bash","label":"npm"},{"cmd":"yarn add react-native-sqlite-mobx","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-native-sqlite-mobx","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for native SQLite module","package":"react-native","optional":false},{"reason":"peer dependency for React base","package":"react","optional":false},{"reason":"used for observable state management","package":"mobx","optional":true},{"reason":"used for observer components","package":"mobx-react-lite","optional":true}],"imports":[{"note":"ESM default? Actually named export. Requires ESM or Babel.","wrong":"const SQLite = require('react-native-sqlite-mobx')","symbol":"SQLite","correct":"import { SQLite } from 'react-native-sqlite-mobx'"},{"note":"Named export, not default.","wrong":"import SQLiteMobxModel from 'react-native-sqlite-mobx'","symbol":"SQLiteMobxModel","correct":"import { SQLiteMobxModel } from 'react-native-sqlite-mobx'"},{"note":"Named export.","wrong":"","symbol":"SQLiteMobxFlatList","correct":"import { SQLiteMobxFlatList } from 'react-native-sqlite-mobx'"}],"quickstart":{"code":"import { SQLite, SQLiteMobxModel, SQLiteMobxFlatList } from 'react-native-sqlite-mobx';\n\n// Initialize SQLite database\nconst db = new SQLite({ name: 'test.db', location: 'default' });\n\n// Create a model extending SQLiteMobxModel\nclass UserModel extends SQLiteMobxModel {\n  constructor() {\n    super({\n      tableName: 'users',\n      db: db,\n      schema: {\n        id: 'INTEGER PRIMARY KEY AUTOINCREMENT',\n        name: 'TEXT',\n        email: 'TEXT UNIQUE'\n      }\n    });\n  }\n}\n\nconst userModel = new UserModel();\n\n// Use CRUD methods\nawait userModel.create({ name: 'John', email: 'john@example.com' });\nconst users = await userModel.read({});\nconsole.log(users);\n\n// Use FlatList\n<SQLiteMobxFlatList\n  model={userModel}\n  renderItem={({ item }) => <Text>{item.name}</Text>}\n/>","lang":"typescript","description":"Demonstrates SQLite initialization, MobX model creation with schema, CRUD usage, and reactive FlatList."},"warnings":[{"fix":"Ensure react-native >=0.61 and react >=16.9.0 are installed.","message":"Peer dependencies react-native and react must be installed. Missing peer deps cause crash on native SQLite operations.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Lock version to 1.x if stability needed; monitor GitHub for updates.","message":"Documentation states 'Under construction' – some APIs may change without notice.","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Provide a writable path like `location: 'Library'` or use `react-native-fs` to get DocumentsDirectory.","message":"SQLite location 'default' may not work on Android emulator; use absolute path or react-native-fs.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'0.61':59 '1.3.18':18 '16.9.0':62 'activ':20,23 'api':29 'app':15 'base':28 'boilerpl':54 'bridg':8 'compon':42 'coupl':46 'crud':34 'current':16 'develop':21 'differenti':43 'javascript':63 'librari':7 'manag':49 'mobx':5,11,30,47 'model':32 'nativ':3,14,58 'observ':31 'oper':35 'persist':52 'promis':27 'promise-bas':26 'provid':24 'react':2,13,57,61 'react-nat':56 'react-native-sqlite-mobx':1 'reactiv':40 'reduc':53 'requir':55 'sqlite':4,9,25,51 'sqlitemobxflatlist':41 'sqlitemobxmodel':37 'state':48 'status':22 'tight':45 'typescript':64 'util':6 'version':17 'via':36","created_at":"2026-06-07T12:58:02.304008+00:00","updated_at":"2026-06-07T12:58:02.304008+00:00","problems":[{"fix":"Run `npx react-native link react-native-sqlite-mobx` and ensure react-native-sqlite-storage is installed.","cause":"Forget to link native module or missing peer dep react-native-sqlite-storage","error":"Module 'react-native-sqlite-mobx' not found or undefined is not an object"},{"fix":"Ensure you pass `{ tableName: '...', db: db, schema: {...} }` to super().","cause":"SQLiteMobxModel super call missing db or tableName config","error":"Cannot read property 'create' 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/carlosroberto555/react-native-sqlite-mobx#readme","github":"https://github.com/carlosroberto555/react-native-sqlite-mobx","docs":null,"changelog":null,"pypi":null,"npm":"react-native-sqlite-mobx","openapi_spec":null,"status_page":null,"smithery":null,"categories":["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}}