{"id":17795021,"url":"https://github.com/hsjoberg/react-native-turbo-sqlite","last_synced_at":"2025-03-16T21:30:58.012Z","repository":{"id":258234356,"uuid":"870752308","full_name":"hsjoberg/react-native-turbo-sqlite","owner":"hsjoberg","description":"A Pure C++ TurboModule for Sqlite","archived":false,"fork":false,"pushed_at":"2024-11-04T15:37:14.000Z","size":4244,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T02:12:00.164Z","etag":null,"topics":["new-architecture","react-native","sqlite","turbomodule"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hsjoberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T15:48:30.000Z","updated_at":"2025-02-01T19:02:51.000Z","dependencies_parsed_at":"2024-10-21T18:15:50.840Z","dependency_job_id":null,"html_url":"https://github.com/hsjoberg/react-native-turbo-sqlite","commit_stats":null,"previous_names":["hsjoberg/react-native-turbo-sqlite"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsjoberg%2Freact-native-turbo-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsjoberg%2Freact-native-turbo-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsjoberg%2Freact-native-turbo-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsjoberg%2Freact-native-turbo-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsjoberg","download_url":"https://codeload.github.com/hsjoberg/react-native-turbo-sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830949,"owners_count":20354854,"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":["new-architecture","react-native","sqlite","turbomodule"],"created_at":"2024-10-27T11:23:03.279Z","updated_at":"2025-03-16T21:30:56.964Z","avatar_url":"https://github.com/hsjoberg.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-turbo-sqlite\n\nA Pure C++ TurboModule for Sqlite.\n\n### Platform support:\n\n```\n✅ Android\n✅ iOS\n✅ macOS\n🚫 Windows (planned)\n🚫 Linux (maybe)\n🚫 Web (maybe)\n✅ Jest mocks (uses sql.js)\n```\n\n## Installation\n\nThis lib requires [new architecture](https://reactnative.dev/docs/the-new-architecture/landing-page)\nenabled in your app. It will not work on the old architecture and there are no plans to support it.\n\n```sh\nyarn add react-native-turbo-sqlite\n```\n\n## Usage\n\n```js\nimport TurboSqlite from \"react-native-turbo-sqlite\";\nimport { DocumentDirectoryPath } from \"@dr.pogodin/react-native-fs\";\n\n// Open the database\nconst db = TurboSqlite.openDatabase(\n  DocumentDirectoryPath + \"/test.db\"\n);\n\n// Create a table\nconst createTableResult = db.executeSql(\n  \"CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER)\",\n  []\n);\nconsole.log(\"Create table result:\", createTableResult);\n\n// Insert some data\nconst insertResult = db.executeSql(\n    \"INSERT INTO users (name, age) VALUES (?, ?)\",\n    [\"Alice\", 30]\n);\nconsole.log(\"Insert result:\", insertResult);\n\n// Select data\nconst selectResult = db.executeSql(\"SELECT * FROM users\", []);\nconsole.log(\"Select result:\", selectResult);\n```\n\n## Why yet another sqlite lib?\n\nCurrent sqlite libs for react-native such as op-sqlite and react-native-quick-sqlite do not support\nout-of-tree platforms like react-native-windows and react-native-macos. Instead of working within\nthose libs I decided to write my own C++ TurboModule that has 100% code-sharing for all platforms.\n\nAny other or future out-of-tree platform should easily be supported as long as it supports new\narchitecture. Let me know if you have any target that you wish should be supported.\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsjoberg%2Freact-native-turbo-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsjoberg%2Freact-native-turbo-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsjoberg%2Freact-native-turbo-sqlite/lists"}