[SQLite](https://www.sqlite.org/index.html) is ubiquitous persistence solution also available in the Fluence stack. Unlike basic compute modules, using SQLite in a service is a little more intricate. In order to create a service, one needs two dependencies:
- SQLite Wasm module that one can get either in a form of a [released module](https://github.com/fluencelabs/sqlite/releases/tag/v0.17.1_w) or build it from scratch following [this](https://github.com/fluencelabs/sqlite) readme.
- SQLite connector that is [WASM IT compliant](https://crates.io/crates/marine-sqlite-connector) [sqlite](https://github.com/fluencelabs/sqlite-wasm-connector) package implementation.
For the purpose of this example, we use the release version -- see `build.sh`.
As a result, our service is comprised of two modules: the SQLite Wasm module and our sqlite module.
## How to build
To build the Wasm modules needed run the following command:
Here is a simple 'CREATE-INSERT-SELECT' scenario using the Wasm modules in the artifacts directory. To follow along, you need marine and mrepl installed.
SQL> SELECT A.id FROM demo_index AS A, demo_index AS B
WHERE A.maxX>=B.minX AND A.minX<=B.maxX
AND A.maxY>=B.minY AND A.minY<=B.maxY
AND B.id=28269 ORDER BY 1;
SELECT A.id FROM demo_index AS A, demo_index AS B WHERE A.maxX>=B.minX AND A.minX<=B.maxX AND A.maxY>=B.minY AND A.minY<=B.maxY AND B.id=28269 ORDER BY 1
Please, [file an issue](https://github.com/fluencelabs/marine/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.
## Contributing
Any 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).
## License
All software code is copyright (c) Fluence Labs, Inc. under the [Apache-2.0](https://github.com/fluencelabs/rust-peer/blob/master/LICENSE) license.