Giter Site home page Giter Site logo

shdb's Introduction

SHDB

Description

A simple and lightweight local key-value pair db for shell script, mainly for data persistence.

Please do not compare SHDB with MySQL, Redis and any other DB programs. SHDB is mainly used on Shell programming, it is easy and simple, only support key-value pair storing, just for shell script programming.

Features

  • Do not occupy any CPU or Memory when in idle moment.
  • Written in pure shell, lightweight and easy to use.
  • Support persistent data storing.
  • Support console mode for quick operation in CLI mode.

Installation Instruction

Clone with SSH

Clone with HTTPS

  • git clone https://github.com/Becavalier/SHDB.git

Installation

Install SHDB use defualt settings:

  • make

Specify the maximum availabe storage size of SHDB:

  • make SIZE=1

Parameter SIZE=1 means set the maximum availabe storage size of SHDB as 1MB. (the maximum size is no more than 1024MB)

Quick Test

  • make test

How to Use

Install (Screenshot)

image

Test (Screenshot)

image

Console Mode (Screenshot)

image

Normal CLI Mode

  • shdb status
  • shdb [-s|--shell] isset [key]
  • shdb [-s|--shell] set [key] [value]
  • shdb [-s|--shell] get [key]
  • shdb [-s|--shell] delete [key]
  • shdb [-s|--shell] count
  • shdb uninstall

Console Mode

Use shdb console to enter the Console mode.

  • isset [key]
  • set [key] [value]
  • get [key]
  • delete [key]
  • count
  • exit

Shell Mode

Please use this mode's syntax in shell programming, demo used for instance.

  • shdb [-s|--shell] isset [key]
  • shdb [-s|--shell] set [key] [value]
  • shdb [-s|--shell] get [key]
  • shdb [-s|--shell] delete [key]
  • shdb [-s|--shell] count

TODO

  • Adapter to blank spaces in content.
  • Optimize storing engin as block storing style.
  • Long length content support.
  • Add new ability to get db storing items' count.
  • Add new ability to choose storing engins (File / GDBM).

Author

@YHSPY

License

MIT

shdb's People

Contributors

becavalier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.