{"id":19316785,"url":"https://github.com/rkusa/wasm-sqlite","last_synced_at":"2025-06-22T20:34:19.193Z","repository":{"id":41174401,"uuid":"451901486","full_name":"rkusa/wasm-sqlite","owner":"rkusa","description":"[Experimental] SQLite compiled to WASM with pluggable page storage.","archived":false,"fork":false,"pushed_at":"2023-02-06T16:33:05.000Z","size":42,"stargazers_count":49,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-20T13:55:04.118Z","etag":null,"topics":["sqlite","vfs","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkusa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-25T14:06:08.000Z","updated_at":"2024-11-07T23:31:09.000Z","dependencies_parsed_at":"2023-02-19T10:00:42.635Z","dependency_job_id":null,"html_url":"https://github.com/rkusa/wasm-sqlite","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/rkusa/wasm-sqlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkusa%2Fwasm-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkusa%2Fwasm-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkusa%2Fwasm-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkusa%2Fwasm-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkusa","download_url":"https://codeload.github.com/rkusa/wasm-sqlite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkusa%2Fwasm-sqlite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261362182,"owners_count":23147349,"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","vfs","wasm"],"created_at":"2024-11-10T01:12:39.850Z","updated_at":"2025-06-22T20:34:14.176Z","avatar_url":"https://github.com/rkusa.png","language":"Rust","readme":"# `wasm-sqlite`\n\nSQLite compiled to WASM with pluggable data storage. Useful to save SQLite in e.g. Cloudflare Durable Objects (example: https://github.com/rkusa/do-sqlite).\n\n**Status:** This is very experimental. Don't use it for real applications yet! See the [conclusion of my blog post](https://ma.rkusa.st/store-sqlite-in-cloudflare-durable-objects#conclusion) for reasons for why not to use it.\n\n```bash\nnpm install -S @rkusa/wasm-sqlite\n```\n\n## Example\n\n```ts\nconst sqlite = await Sqlite.instantiate({\n  pageCount(): number {\n    return self.pageCount;\n  },\n\n  async getPage(ix: number): Promise\u003cUint8Array\u003e {\n    return (await storage.get(ix)) ?? new Uint8Array(4096);\n  },\n\n  async putPage(ix: number, page: Uint8Array): Promise\u003cvoid\u003e {\n    await storage.put(ix, page);\n  },\n\n  async delPage(ix: number): Promise\u003cvoid\u003e {\n    await storage.delete(ix);\n    if (ix + 1 \u003e= self.pageCount) {\n      self.pageCount = ix;\n    }\n  },\n});\n\nconst conn = await this.sqlite.connect();\nawait conn.execute(\"...\", []);\nconst query: T = await conn.query(\"...\", []);\n```\n\n## Build\n\nExecute the following once:\n\n```bash\nbrew install cmake ninja binaryen\n./build-wasi-sdk.sh\n```\n\nAfter that, build it via:\n\n```bash\nnpm run build\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkusa%2Fwasm-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkusa%2Fwasm-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkusa%2Fwasm-sqlite/lists"}