{"id":25440808,"url":"https://github.com/sqlitecloud/sqlitecloud-js","last_synced_at":"2025-11-01T11:30:34.720Z","repository":{"id":206188398,"uuid":"528857500","full_name":"sqlitecloud/sqlitecloud-js","owner":"sqlitecloud","description":"Javascript drivers for SQLiteCloud","archived":false,"fork":false,"pushed_at":"2025-02-10T14:43:52.000Z","size":12630,"stargazers_count":17,"open_issues_count":16,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-16T11:36:54.648Z","etag":null,"topics":["sqlite","sqlite-orm","sqlite3","sqlitecloud"],"latest_commit_sha":null,"homepage":"https://sqlitecloud.github.io/sqlitecloud-js/","language":"TypeScript","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/sqlitecloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-08-25T13:13:14.000Z","updated_at":"2025-02-10T14:40:52.000Z","dependencies_parsed_at":"2024-01-01T09:07:35.258Z","dependency_job_id":"783bbb06-f9f6-4486-9d8e-64511b821a54","html_url":"https://github.com/sqlitecloud/sqlitecloud-js","commit_stats":{"total_commits":200,"total_committers":3,"mean_commits":66.66666666666667,"dds":"0.22499999999999998","last_synced_commit":"f07abc11dc9f4459819e689edd9298420aac4a76"},"previous_names":["sqlitecloud/sqlitecloud-js"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlitecloud%2Fsqlitecloud-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlitecloud%2Fsqlitecloud-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlitecloud%2Fsqlitecloud-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlitecloud%2Fsqlitecloud-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlitecloud","download_url":"https://codeload.github.com/sqlitecloud/sqlitecloud-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239126481,"owners_count":19586100,"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":["sqlite","sqlite-orm","sqlite3","sqlitecloud"],"created_at":"2025-02-17T12:18:18.654Z","updated_at":"2025-11-01T11:30:34.667Z","avatar_url":"https://github.com/sqlitecloud.png","language":"TypeScript","readme":"# @sqlitecloud/drivers\n\n[![npm package][npm-img]][npm-url]\n[![Test][test-img]][test-url]\n[![Downloads][downloads-img]][downloads-url]\n[![Issues][issues-img]][issues-url]\n[![codecov](https://codecov.io/gh/sqlitecloud/sqlitecloud-js/graph/badge.svg?token=ZOKE9WFH62)](https://codecov.io/gh/sqlitecloud/sqlitecloud-js)\n\n## Install\n\n```bash\nnpm install @sqlitecloud/drivers\n```\n\n## React Native / Expo Install\n\nYou also have to install Peer Dependencies\n\n```bash\nnpm install @sqlitecloud/drivers react-native-tcp-socket react-native-quick-base64\n```\n\nReact Native run iOS\n\n```bash\ncd ios \u0026\u0026 pod install \u0026\u0026 cd .. \u0026\u0026 npm run ios\n```\n\nReact Native run Android (without ./ in Windows)\n\n```bash\ncd android \u0026\u0026 ./gradlew clean build \u0026\u0026 cd .. \u0026\u0026 npm run android\n```\n\nExpo run iOS\n\n```bash\nnpx expo prebuild \u0026\u0026 npx expo run:ios\n```\n\nExpo run Android\n\n```bash\nnpx expo prebuild \u0026\u0026 npx expo run:android\n```\n\n## Usage\n\n```ts\nimport { Database } from '@sqlitecloud/drivers'\n\nlet database = new Database('sqlitecloud://user:password@xxx.sqlite.cloud:8860/chinook.sqlite')\n// or use sqlitecloud://xxx.sqlite.cloud:8860?apikey=xxxxxxx\n\nlet name = 'Breaking The Rules'\n\nlet results = await database.sql`SELECT * FROM tracks WHERE name = ${name}`\n// =\u003e returns [{ AlbumId: 1, Name: 'Breaking The Rules', Composer: 'Angus Young... }]\n```\n\nUse [Database.sql](https://sqlitecloud.github.io/sqlitecloud-js/classes/Database.html#sql) to execute prepared statements or plain SQL queries asynchronously. This method returns an array of rows for SELECT queries and supports the standard syntax for UPDATE, INSERT, and DELETE.\n\nWe aim for full compatibility with the established [sqlite3 API](https://www.npmjs.com/package/sqlite3), with the primary distinction being that our driver connects to SQLiteCloud databases. This allows you to migrate your [SQLite to the cloud](https://sqlitecloud.io) while continuing to use your existing codebase.\n\nThe package is developed entirely in TypeScript and is fully compatible with JavaScript. It doesn't require any native libraries. This makes it a straightforward and effective tool for managing cloud-based databases in a familiar SQLite environment.\n\n## Publish / Subscribe (Pub/Sub)\n\n```ts\nimport { Database } from '@sqlitecloud/drivers'\nimport { PubSub, PUBSUB_ENTITY_TYPE } from '@sqlitecloud/drivers/lib/drivers/pubsub'\n\nlet database = new Database('sqlitecloud://user:password@xxx.sqlite.cloud:8860/chinook.sqlite')\n// or use sqlitecloud://xxx.sqlite.cloud:8860?apikey=xxxxxxx\n\nconst pubSub: PubSub = await database.getPubSub()\n\nawait pubSub.listen(PUBSUB_ENTITY_TYPE.TABLE, 'albums', (error, results, data) =\u003e {\n  if (results) {\n    // Changes on albums table will be received here as JSON object\n    console.log('Received message:', results)\n  }\n})\n\nawait database.sql`INSERT INTO albums (Title, ArtistId) values ('Brand new song', 1)`\n\n// Stop listening changes on the table\nawait pubSub.unlisten(PUBSUB_ENTITY_TYPE.TABLE, 'albums')\n```\n\nPub/Sub is a messaging pattern that allows multiple applications to communicate with each other asynchronously. In the context of SQLiteCloud, Pub/Sub can be used to provide real-time updates and notifications to subscribed applications whenever data changes in the database or it can be used to send payloads (messages) to anyone subscribed to a channel.\n\nPub/Sub Documentation: [https://docs.sqlitecloud.io/docs/pub-sub](https://docs.sqlitecloud.io/docs/pub-sub)\n\n## Examples\n\nCheck out all the supported platforms with related examples [here](https://github.com/sqlitecloud/sqlitecloud-js/tree/main/examples)!\n\n## More\n\nHow do I deploy SQLite in the cloud?  \n[https://sqlitecloud.io](https://sqlitecloud.io)\n\nHow do I connect SQLite cloud with Javascript?  \n[https://sqlitecloud.github.io/sqlitecloud-js/](https://sqlitecloud.github.io/sqlitecloud-js/)\n\nHow can I contribute or suggest features?  \n[https://github.com/sqlitecloud/sqlitecloud-js/issues](https://github.com/sqlitecloud/sqlitecloud-js/issues)\n\n[test-img]: https://img.shields.io/github/actions/workflow/status/sqlitecloud/sqlitecloud-js/test.yml?label=Android%20%7C%20iOS%20%7C%20Web%20%7C%20Windows%20%7C%20MacOS%20%7C%20Linux\n[test-url]: https://github.com/sqlitecloud/sqlitecloud-js/actions/workflows/test.yml\n[downloads-img]: https://img.shields.io/npm/dt/@sqlitecloud/drivers\n[downloads-url]: https://www.npmtrends.com/@sqlitecloud/drivers\n[npm-img]: https://img.shields.io/npm/v/@sqlitecloud/drivers\n[npm-url]: https://www.npmjs.com/package/@sqlitecloud/drivers\n[issues-img]: https://img.shields.io/github/issues/sqlitecloud/sqlitecloud-js\n[issues-url]: https://github.com/sqlitecloud/sqlitecloud-js/issues\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlitecloud%2Fsqlitecloud-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlitecloud%2Fsqlitecloud-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlitecloud%2Fsqlitecloud-js/lists"}