Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HassenSaidi/IC_sqlite
Port of the SQL database engine SQLite to the Internet Computer
https://github.com/HassenSaidi/IC_sqlite
Last synced: 3 months ago
JSON representation
Port of the SQL database engine SQLite to the Internet Computer
- Host: GitHub
- URL: https://github.com/HassenSaidi/IC_sqlite
- Owner: HassenSaidi
- License: apache-2.0
- Created: 2021-02-16T06:50:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-02-16T08:19:05.000Z (over 3 years ago)
- Last Synced: 2024-06-21T18:11:03.457Z (5 months ago)
- Language: C
- Homepage:
- Size: 2.49 MB
- Stars: 24
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-icp - HassenSaidi/IC_sqlite
README
# IC_sqlite
This is a port of the SQL database engine SQLite to the
Internet Computer. SQLite is one of the most widely used database
software. An SQLite database is normally stored in a single ordinary
disk file. However, there is a possibility to force an SQLite
database to exist purely in memory. The IC's orthogonal persistence
guarantees that a database create in memory is automatically
persisted.This port consists of compiling an unmodified source code of SQLite to
WebAssembly and providing a simple canister `src/sqlite3-canister.c`
exposing a database `update` and `query` interfaces.# Content
The project contains:
* a pre-built sqlite.wasm canister ready to deploy to the IC
* a sqlite.did file containing the functions exposed by the canister:
* `sqlite_init: () -> (int)` to initialize the database
* `sqlite_update: (SQL statement text) -> (SQLite Result Code)` to update the database
* `sqlite_query: (SQL statement text) -> (Query result text)` to query the database
* source code to build `sqlite.wasm` in the `src` folder. Since there is no official C SDK yet for building canisters, I lifted most of the C interface with the IC from [this example](https://github.com/enzoh/counter).# Dependencies
To build the project, you need:
* a compiler: `clang-8` or newer versions of the clang compiler.
* wasi-sdk with a pre-built libc.a. Technically, you don't need to use `wasi` at all. You can build your own libc.a independently.
* the DFINITY sdk to run a local replica and to install the canister.