Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cub11k/database

Open more actions menu

Repository files navigation

Database

Simple client-server non-relational database

Internal structure consists of two red black trees and one std::unordered_map

Install

git clone https://github.com/Cub1tor/database.git
cd database

Build

make
# or
make all

# to remove build files use
make clean

Usage

./server
./client {Address} {Port}
# for example
./client localhost 8080

Database interface

Server

  • exit - stop server

Client

  • INSERT name=STRING group=INT rating=DOUBLE info=STRING END
  • UPDATE {name=STRING group=INT rating=DOUBLE info=STRING} WHERE {Criteria} END
  • DELETE {Criteria} END
  • SELECT {Criteria} END
  • RESELECT {Criteria} END
  • PRINT <count=INT> {name group rating *} SORT {ASC|DESC} {name group rating} END
  • LOAD file=FILENAME END
  • DUMP file=FILENAME END

Criteria

  • list of Entries connected by AND|OR

Entry

  • key=list of Values divided by ','

Keys

  • name
  • group
  • rating

Values

  • value → equal
  • regex with asterisks* is any sequence of symbols, only for name
  • *-value → less or equal, only for group and rating
  • value-* → more or equal, only for group and rating
  • value1-value2 → between, only for group and rating

Examples

INSERT name="Cub1tor" group=204 rating=4.37 info="C++ programmer" END
UPDATE name=Cub1tor rating=4.37 info="C++ programmer" WHERE name=Cub* AND group=204 END
DELETE group=210 END
SELECT * END
RESELECT rating=4.2-5 END
PRINT count=10 name group SORT DESC group END
PRINT count=5 * SORT ASC group name rating END
LOAD file=load.json END
DUMP file=dump.json END

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.