{"id":16209159,"url":"https://github.com/gilzoide/idbvfs","last_synced_at":"2025-04-10T10:14:55.425Z","repository":{"id":248029431,"uuid":"825319514","full_name":"gilzoide/idbvfs","owner":"gilzoide","description":"WebAssembly SQLite VFS for web browsers, powered by IndexedDB","archived":false,"fork":false,"pushed_at":"2024-09-29T15:01:05.000Z","size":4202,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T01:27:19.205Z","etag":null,"topics":["emscripten","indexed-db","indexeddb","sqlite","sqlite-vfs","sqlite3","web","webassembly"],"latest_commit_sha":null,"homepage":"https://gilzoide.github.io/idbvfs/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gilzoide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["gilzoide"],"patreon":null,"open_collective":null,"ko_fi":"gilzoide","tidelift":null,"community_bridge":null,"liberapay":"gilzoide","issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-07-07T12:59:43.000Z","updated_at":"2025-04-02T00:12:15.000Z","dependencies_parsed_at":"2024-07-12T00:48:08.093Z","dependency_job_id":"7742e3b8-44eb-40ff-8f5a-014a84e2cc38","html_url":"https://github.com/gilzoide/idbvfs","commit_stats":null,"previous_names":["gilzoide/idbvfs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilzoide%2Fidbvfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilzoide%2Fidbvfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilzoide%2Fidbvfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilzoide%2Fidbvfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilzoide","download_url":"https://codeload.github.com/gilzoide/idbvfs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248198893,"owners_count":21063628,"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":["emscripten","indexed-db","indexeddb","sqlite","sqlite-vfs","sqlite3","web","webassembly"],"created_at":"2024-10-10T10:28:14.887Z","updated_at":"2025-04-10T10:14:55.399Z","avatar_url":"https://github.com/gilzoide.png","language":"C","funding_links":["https://github.com/sponsors/gilzoide","https://ko-fi.com/gilzoide","https://liberapay.com/gilzoide"],"categories":[],"sub_categories":[],"readme":"# idbvfs\nWebAssembly + Emscripten [SQLite](https://sqlite.org/) [VFS](https://www.sqlite.org/vfs.html) for web browsers, powered by [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API).\n\nCheckout the live demo: https://gilzoide.github.io/idbvfs/\n\n\n### This project is for...\n- Web browser applications that use SQLite directly from WebAssembly-compiled code, for example apps built using C/C++ game engines\n\n\n### This project is NOT for...\n- Web browser applications that use SQLite from JavaScript, like users of [sqlite3.wasm](https://sqlite.org/wasm) or [sql.js](https://sql.js.org/)\n\n\n## Caveats\n- This project implements only the SQLite VFS that uses IndexedDB for persistence.\n  You must compile and link SQLite with your app yourself.\n  This project is supposed to be statically linked to your WebAssembly applications.\n- This VFS does not implement any file locking mechanism.\n  Just make sure there's a single database connection to each file and you should be fine.\n\n\n## How to use\nTL;DR: call `idbvfs_register` before opening your SQLite databases and that's it!\n```c\n// 1. Include `idbvfs.h`\n#include \u003cidbvfs.h\u003e\n\n// 2. Somewhere in your app's initialization, register idbvfs.\n// Pass `1` to make idbvfs the default VFS for new connections.\nint result = idbvfs_register(1);\nif (restult != SQLITE_OK) {\n    // handle errors if necessary...\n}\n\n// 3. Just use SQLite normally\nsqlite3 *db;\nint result = sqlite3_open_v2(\n  \"mydb\", \u0026db,\n  SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE,\n  IDBVFS_NAME\n);\n// The above is the same as below, if idbvfs is the default VFS\n// int result = sqlite3_open(\"mydb\", \u0026db);\n```\n\n\n### Linking idbvfs in CMake builds:\n```cmake\n# 1. Import `idbvfs` as a subdirectory\n# This will build idbvfs as a static library\nadd_subdirectory(path/to/idbvfs)\n\n# 2. Link your library/executable to the `idbvfs` library\n# This will also add the necessary includes for `idbvfs.h`\n# as well as link the IDBFS library\ntarget_link_libraries(my-wasm-app PUBLIC idbvfs)\n```\n\n\n### Linking idbvfs in non-CMake builds:\n```sh\n# 1. Compile idbvfs using CMake, from the project root\n# This will output a static library at `build/libidbvfs.a`\nemcmake cmake . -B build -DCMAKE_BUILD_TYPE=Release\ncmake --build build\n\n# 2. Link your app with `build/libidbvfs.a`.\n# Don't forget to add `-lidbfs.js` link option or idbvfs will not work!\nemcc -o my-wasm-app my-wasm-app.o \\\n  -lidbfs.js \\\n  -Lidbvfs/build -lidbvfs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilzoide%2Fidbvfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilzoide%2Fidbvfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilzoide%2Fidbvfs/lists"}