piladb.sh
is a set of utilities to interact with piladb
from the command line or shell scripts. It aims to make simple interactions with a piladb server
in an easy and fast way.
- Unix/Linux machine with bash, zsh or similar shell in use.
- HTTPie: https://github.com/jkbrzt/httpie#installation
PILADB_HOST
set for remote server, e.g.export PILADB_HOST=piladb.example.org
source <(curl -s https://raw.githubusercontent.com/oscillatingworks/piladb-sh/master/piladb.sh)
Now type piladb_[TAB]
and you will see a bunch of piladb related commands.
See piladb_help
.
Run bash piladb_test.sh
.
Start a local server, create a database and a stack, PUSH
a random number,
a string, a boolean, a JSON payload, and then stop the server:
#!/bin/bash
piladb_start
piladb_create_database MYDB
piladb_create_stack MYDB MYSTACK
piladb_PUSH MYDB MYSTACK $(( ( RANDOM % 10 )))
piladb_PUSH MYDB MYSTACK '"A string"'
piladb_PUSH MYDB MYSTACK true
piladb_PUSH MYDB MYSTACK '{"country":"ES"}'
piladb_POP MYDB MYSTACK
piladb_stop
Connect to a remote server, check status:
export PILADB_HOST=mypiladb.example.com
piladb_status
Download latest version of pilad
and start server:
piladb_download
piladb_start
MIT