Code Monkey home page Code Monkey logo

bash-db's Introduction

bash-db

Very simple Key-Value database on bash script. Depends on pre-installed software only (tested on Ubuntu 14.04 LTS):

  • sed
  • bash
  • grep
  • base64
  • xargs

Install

bpkg (global package)

bpkg install reddec/bash-db

Make (/usr/local/bin)

make install

Manual Installation

git clone https://github.com/reddec/bash-db
cd bash-db
chmod +x db.sh
cp db.sh /usr/local/bin/db

Usage

Command-line Tool

db <method> <database> [arguments...]

Methods:

PUT

Insert or update record.

Arg Description
key (required) Unique key. Can be used any value (also spaces if value in bracets)
value (optional) Value of record. Can be used any value (also spaces if value in bracets). If value not set, STDIN will be used.

Example:

db put test.db name 'Red Dec'

GET

Get value of record by key

Arg Description
key (required) Unique key. Can be used any value (also spaces if value in bracets)

Example:

db get test.db name

LIST

Get all keys in database

No arguments

Example:

db list test.db

LAST

Get the value of the last added record

No arguments

Example:

db last test.db

DELETE

Delete record by key

Arg Description
key (required) Unique key. Can be used any value (also spaces if value in bracets)

Example:

db delete test.db name

bash-db's People

Contributors

dskvr avatar hardy8118 avatar ptitluc avatar reddec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bash-db's Issues

Additional db file being created

Hello. I am getting another db file being created with same name appended with a r when updating value.

For example when I insert some data
./db.sh put testdb hello world
a file named testdb is created.
When I update the data using
./db.sh put testdb hello world
another file named testdbr is created.

I was wondering that was this intended.
I checked the code and did not found what part caused this.

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.