/use-rqlite-go

My rqlite Go example

Primary LanguageShell

About

Build

My rqlite Go example.

Usage

This can be tested in docker compose or in a kind kubernetes cluster.

List this repository dependencies (and which have newer versions):

GITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh

Usage (docker compose)

Install docker and docker compose.

Create the environment:

docker compose up --build --detach
docker compose ps
docker compose logs

Start the rqlite client:

docker compose exec rqlite rqlite

Execute some commands:

PRAGMA compile_options -- show enabled extensions (e.g. fts, geopoly), et al.
.status
.nodes
.schema
select sqlite_version()
insert into quote(id, author, text, url) values(100, "Hamlet", "To be, or not to be, that is the question.", null)
select text || ' -- ' || author as quote from quote
.exit

Get a quote from the service:

wget -qO- http://localhost:4000

Destroy the environment:

docker compose down --volumes --remove-orphans

Usage (Kubernetes)

Install docker, kind, kubectl, and helm.

Create the local test infrastructure:

./.github/workflows/kind/create.sh

Access the test infrastructure kind Kubernetes cluster:

export KUBECONFIG="$PWD/kubeconfig.yml"
kubectl get nodes -o wide

Build and use the use-rqlite-go example:

./build.sh && ./deploy.sh && ./test.sh && xdg-open index.html

Start the rqlite client:

kubectl exec --quiet --stdin --tty statefulset/rqlite -- rqlite

Execute some commands:

PRAGMA compile_options -- show enabled extensions (e.g. fts, geopoly), et al.
.status
.nodes
.schema
select sqlite_version()
insert into quote(id, author, text, url) values(100, "Hamlet", "To be, or not to be, that is the question.", null)
select text || ' -- ' || author as quote from quote
.exit

Destroy the local test infrastructure:

./.github/workflows/kind/destroy.sh

References