Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rgl/use-rqlite-go
My rqlite Go example
https://github.com/rgl/use-rqlite-go
go golang rqlite sqlite
Last synced: 24 days ago
JSON representation
My rqlite Go example
- Host: GitHub
- URL: https://github.com/rgl/use-rqlite-go
- Owner: rgl
- Created: 2024-06-16T07:05:55.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-22T15:04:36.000Z (5 months ago)
- Last Synced: 2024-10-05T18:21:41.449Z (about 1 month ago)
- Topics: go, golang, rqlite, sqlite
- Language: Shell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
[![Build](https://github.com/rgl/use-rqlite-go/actions/workflows/main.yml/badge.svg)](https://github.com/rgl/use-rqlite-go/actions/workflows/main.yml)
My [rqlite](https://github.com/rqlite/rqlite) Go example.
# Usage
This can be tested [in docker compose](#usage-docker-compose) or [in a kind kubernetes cluster](#usage-kubernetes).
List this repository dependencies (and which have newer versions):
```bash
GITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh
```## Usage (docker compose)
Install docker and docker compose.
Create the environment:
```bash
docker compose up --build --detach
docker compose ps
docker compose logs
```Start the rqlite client:
```bash
docker compose exec rqlite rqlite
```Execute some commands:
```
.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:
```bash
wget -qO- http://localhost:4000
```Destroy the environment:
```bash
docker compose down --volumes --remove-orphans
```## Usage (Kubernetes)
Install docker, kind, kubectl, and helm.
Create the local test infrastructure:
```bash
./.github/workflows/kind/create.sh
```Access the test infrastructure kind Kubernetes cluster:
```bash
export KUBECONFIG="$PWD/kubeconfig.yml"
kubectl get nodes -o wide
```Start the rqlite client:
```bash
kubectl exec --quiet --stdin --tty statefulset/rqlite -- rqlite
```Execute some commands:
```
.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
```Build and use the use-rqlite-go example:
```bash
./build.sh && ./deploy.sh && ./test.sh && xdg-open index.html
```Destroy the local test infrastructure:
```bash
./.github/workflows/kind/destroy.sh
```# References
* [rqlite homepage](https://rqlite.io)
* [rqlite source-code repositories](https://github.com/rqlite)
* [rqlite Go client (gorqlite)](https://github.com/rqlite/gorqlite)