{"id":28545814,"url":"https://github.com/fluencelabs/sqlite","last_synced_at":"2025-07-04T15:38:48.393Z","repository":{"id":47309992,"uuid":"197764401","full_name":"fluencelabs/sqlite","owner":"fluencelabs","description":"SQLite fork ported to WebAssembly","archived":false,"fork":false,"pushed_at":"2023-12-25T13:26:37.000Z","size":4037,"stargazers_count":46,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-12-25T22:33:54.825Z","etag":null,"topics":["desentralized-database","sqlite","wasm","webassembly"],"latest_commit_sha":null,"homepage":null,"language":"C","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/fluencelabs.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2019-07-19T11:53:51.000Z","updated_at":"2023-12-25T22:33:54.826Z","dependencies_parsed_at":"2023-12-24T22:30:00.829Z","dependency_job_id":"f6dc03d8-2c28-4fad-9d48-14d7607761af","html_url":"https://github.com/fluencelabs/sqlite","commit_stats":null,"previous_names":[],"tags_count":20,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Fsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Fsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Fsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Fsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluencelabs","download_url":"https://codeload.github.com/fluencelabs/sqlite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluencelabs%2Fsqlite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258971313,"owners_count":22786066,"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":["desentralized-database","sqlite","wasm","webassembly"],"created_at":"2025-06-09T23:08:35.516Z","updated_at":"2025-07-04T15:38:48.387Z","avatar_url":"https://github.com/fluencelabs.png","language":"C","readme":"# SQLite\n\n\n## Overview\nSQLite fork adapted to work with Fluence the protocol. The current version is based on SQLite version 3.40.1. The artifact is SQLite WASM module:\n\n\n- that is compiled following [Marine runtime ABI conventions](https://fluence.dev/docs/marine-book/marine-rust-sdk/module-abi)\n- to be used with [Marine runtime](https://github.com/fluencelabs/marine)\n\n\n## How to build\n\n\n\nWasm module can be built with either docker-compose\n\n\n\n```bash\n\ndocker-compose up\n\n```\n\n\n\nor using this [Makefile](./Makefile) with GNU make. There are prerequisites to be installed following this path, namely [wasi-sdk](https://github.com/WebAssembly/wasi-sdk) and marine crate. Take a look at the Dockerfile for the details.\n\n\n```bash\n\nmake\n\n```\n\n\n\n## How to use\n\n\n\nThe SQLite Wasm module exports a set of SQLite C API functions. The easiest way to try this module is to run it with Marine REPL.\nYou can find MREPL output for a simple \"CREATE-INSERT-SELECT\" scenario below. Mind the second argument to sqlite3_open_v2() that is an OR-ed SQLite flag values. The value \"6\" in this context means `SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE`.\n\n\n```bash\n$cargo install mrepl\n...\n$mrepl -q Config.toml\n\n1\u003e call sqlite3 sqlite3_open_v2 [\":memory:\",6,\"\"]\nresult: {\n  \"db_handle\": 198600,\n  \"ret_code\": 0\n}\n elapsed time: 357.556µs\n\n2\u003e call sqlite3 sqlite3_exec [198600, \"CREATE TABLE tab1(i bigint);\", 0, 0]\nresult: {\n  \"err_msg\": \"\",\n  \"ret_code\": 0\n}\n elapsed time: 1.736661ms\n\n3\u003e call sqlite3 sqlite3_exec [198600, \"INSERT INTO tab1 VALUES (42);\", 0, 0]\nresult: {\n  \"err_msg\": \"\",\n  \"ret_code\": 0\n}\n elapsed time: 330.098µs\n\n4\u003e call sqlite3 sqlite3_prepare_v2 [198600, \"SELECT * FROM tab1;\"]\nresult: {\n  \"ret_code\": 0,\n  \"stmt_handle\": 244584,\n  \"tail\": 268147\n}\n elapsed time: 280.668µs\n\n5\u003e call sqlite3 sqlite3_step [244584]\nresult: 100\n elapsed time: 124.122µs\n\n6\u003e call sqlite3 sqlite3_column_int64 [244584,0]\nresult: 42\n elapsed time: 72.483µs\n\n```\n\n\nYou can also try the SQLite Wasm module using Rust together with [this Sqlite connector](https://github.com/fluencelabs/sqlite-wasm-connector). [Here](https://github.com/fluencelabs/examples/tree/main/marine-examples/sqlite) you can find a simple SQL REPL utility example built into a Wasm module.\n\n## Support\n\nPlease, [file an issue](https://github.com/fluencelabs/sqlite/issues) if you find a bug. You can also contact us at [Discord](https://discord.com/invite/5qSnPZKh7u) or [Telegram](https://t.me/fluence_project).  We will do our best to resolve the issue ASAP.\n\n\n## Contributing\n\nAny interested person is welcome to contribute to the project. Please, make sure you read and follow some basic [rules](https://github.com/fluencelabs/rust-peer/blob/master/CONTRIBUTING.md).\n\n\n## License\n\nAll software code is copyright (c) Fluence Labs, Inc. under the [Apache-2.0](https://github.com/fluencelabs/rust-peer/blob/master/LICENSE) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluencelabs%2Fsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluencelabs%2Fsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluencelabs%2Fsqlite/lists"}