{"id":13462954,"url":"https://github.com/almost/react-native-sqlite","last_synced_at":"2025-04-05T17:05:55.494Z","repository":{"id":29842525,"uuid":"33387284","full_name":"almost/react-native-sqlite","owner":"almost","description":"SQLite3 bindings for React Native","archived":false,"fork":false,"pushed_at":"2015-12-31T16:27:57.000Z","size":31,"stargazers_count":537,"open_issues_count":8,"forks_count":48,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-29T16:05:34.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"codefellows-seattle-javascript-401d21/30-hash-tables","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/almost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T23:19:41.000Z","updated_at":"2024-09-19T13:45:23.000Z","dependencies_parsed_at":"2022-09-06T15:41:00.412Z","dependency_job_id":null,"html_url":"https://github.com/almost/react-native-sqlite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost%2Freact-native-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost%2Freact-native-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost%2Freact-native-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost%2Freact-native-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almost","download_url":"https://codeload.github.com/almost/react-native-sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:42.153Z","updated_at":"2025-04-05T17:05:55.470Z","avatar_url":"https://github.com/almost.png","language":"Objective-C","readme":"# react-native-sqlite\n\nNOTE: This hasn't been maintained for a while and was never very complete to start with. Check out https://github.com/andpor/react-native-sqlite-storage for a more usable library!\n\nA binding for sqlite3 for React Native. Allows a database to be opened and for SQL queries to be run on it.\n\nWritten by Thomas Parslow\n([almostobsolete.net](http://almostobsolete.net) and\n[tomparslow.co.uk](http://tomparslow.co.uk)) as part of Active Inbox\n([activeinboxhq.com](http://activeinboxhq.com/)).\n\n## Installation\n\nInstall using npm with `npm install --save react-native-sqlite`\n\nYou then need to add the Objective C part to your XCode project. Drag\n`AIBSQLite.xcodeproj` from the `node_modules/react-native-sqlite` folder into your XCode project. Click on the project in XCode, goto `Build Phases` then `Link Binary With Libraries` and add `libAIBSQLite.a` and `libsqlite3.dylib`.\n\nNOTE: Make sure you don't have the `AIBSQLite` project open seperately in XCode otherwise it won't work.\n\n## Usage\n\n```javascript\nvar sqlite = require('react-native-sqlite');\nsqlite.open(\"filename.sqlite\", function (error, database) {\n  if (error) {\n    console.log(\"Failed to open database:\", error);\n    return;\n  }\n  var sql = \"SELECT a, b FROM table WHERE field=? AND otherfield=?\";\n  var params = [\"somestring\", 99];\n  database.executeSQL(sql, params, rowCallback, completeCallback);\n  function rowCallback(rowData) {\n    console.log(\"Got row data:\", rowData);\n  }\n  function completeCallback(error) {\n    if (error) {\n      console.log(\"Failed to execute query:\", error);\n      return\n    }\n    console.log(\"Query complete!\");\n    database.close(function (error) {\n      if (error) {\n        console.log(\"Failed to close database:\", error);\n        return\n      }\n    });\n  }\n});\n```\n\n## Database Location\n\nIt will first look for the database filename you give in the `Documents` directory inside the app sandbox. If it doesn't find anything there it will look in the app bundle and try and copy it to the `Documents` directory. If it doesn't find the database in either place then it will create a new blank database in the `Documents` directory.\n\nIn the future it should probably be made possible to open/create databases in the `tmp` and `Libraries` directories.\n\n## Known Issues\n\n- Doesn't support reading of BLOB fields right now. I'm not entirely sure what would be the best way to pass back binary data. Maybe Base64?\n- Database needs to be closed manually. I'm not sure how I could do\n  this automatically.\n\n\n## Feedback Welcome!\n\nFeedback, questions, suggestions and most of all Pull Requests are\nvery welcome. This is an early version and I want to figure out the\nbest way to continue it.\n\nI'm also available for freelance work!\n\nI'm [@almostobsolete](http://twitter.com/almostobsolete) on Twitter my\nemail is [tom@almostobsolete.net](mailto:tom@almostobsolete.net) and\nyou can find me on the web at\n[tomparslow.co.uk](http://tomparslow.co.uk) and\n[almostobsolete.net](http://almostobsolete.net)\n","funding_links":[],"categories":["Components","Objective-C"],"sub_categories":["Storage"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmost%2Freact-native-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmost%2Freact-native-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmost%2Freact-native-sqlite/lists"}