Quick Start
This guide will walk you through the process of downloading and using Mycelite with the SQLite command line program. At the end of this guide, you'll have a working writer and reader instance of Mycelite that are synchronized.
Prerequisites
You'll need a version of SQLite that allows using extensions.
- Homebrew
- Chocolatey
brew install sqlite
IMPORTANT: follow the instructions to add the SQLite binary to your path then restart your terminal or source your profile.
choco install sqlite.shell
Download the extension
- Mac Arm
- Mac x86
- Linux Arm
- Linux x86 gnu
- Linux x86 musl
- Windows x86 gnu
- Windows x86 msvc
curl -L https://github.com/mycelial/mycelite/releases/latest/download/aarch64-apple-darwin.tgz --output aarch64-apple-darwin.tgz
tar -xvzf aarch64-apple-darwin.tgz
curl -L https://github.com/mycelial/mycelite/releases/latest/download/x86_64-apple-darwin.tgz --output x86_64-apple-darwin.tgz
tar -xvzf x86_64-apple-darwin.tgz
curl -L https://github.com/mycelial/mycelite/releases/latest/download/arm-unknown-linux-gnueabihf.tgz --output arm-unknown-linux-gnueabihf.tgz
tar -xvzf arm-unknown-linux-gnueabihf.tgz
curl -L https://github.com/mycelial/mycelite/releases/latest/download/x86_64-unknown-linux-gnu.tgz --output x86_64-unknown-linux-gnu.tgz
tar -xvzf x86_64-unknown-linux-gnu.tgz
curl -L https://github.com/mycelial/mycelite/releases/latest/download/x86_64-unknown-linux-musl.tgz --output x86_64-unknown-linux-musl.tgz
tar -xvzf x86_64-unknown-linux-musl.tgz
curl.exe -L https://github.com/mycelial/mycelite/releases/latest/download/x86_64-pc-windows-gnu.zip --output x86_64-pc-windows-gnu.zip
tar.exe -xvzf x86_64-pc-windows-gnu.zip
curl.exe -L https://github.com/mycelial/mycelite/releases/latest/download/x86_64-pc-windows-msvc.zip --output x86_64-pc-windows-msvc.zip
tar.exe -xvzf x86_64-pc-windows-msvc.zip
Configuring the writer
Start the SQLite command line program
sqlite3
Load the extension
.load ./libmycelite mycelite_writer
Open a new database as a writer
.open writer.db
Configure Mycelite
The first time you use Mycelite, you'll need to load the configuration extension and configure Mycelite, subsequently, you can skip this step.
.load ./libmycelite mycelite_config
Signup for a free account on the hub and retrieve your user name and secret.
Configure Mycelite by running the following insert statement. The domain is a slug-like unique name of your choosing. The client_id is your user name and the secret is obtained from the hub.
insert into mycelite_config values
('domain', '<domain>/<db-name>'),
('client_id', '<your-hub-username>'),
('secret', '<secret-from-hub>');
You can verify the config with the following SQL statement.
select * from mycelite_config;
Configuring the reader
Start the SQLite command line program
sqlite3
Load the extension
.load ./libmycelite mycelite_reader
Open a new database as a reader
.open reader.db
Configure Mycelite
The first time you use Mycelite, you'll need to load the configuration extension and configure Mycelite, subsequently, you can skip this step.
.load ./libmycelite mycelite_config
Configure Mycelite by running the following insert statement. The domain is a slug-like unique name of your choosing. The client_id is your user name and the secret is obtained from the hub.
insert into mycelite_config values
('domain', '<domain>/<db-name>'),
('client_id', '<your-hub-username>'),
('secret', '<secret-from-hub>');
You can verify the config with the following SQL statement.
select * from mycelite_config;
Observing Synchronization
In the writer instance, create a table and then insert a row in the writer instance.
create table test(number integer);
insert into test(number) values (42);
Now in the reader instance, you will see the new table and you can query it.
.tables
select * from test;