Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kazooki123/lunardb
LunarDB is a cache key-value store database made in C++
https://github.com/kazooki123/lunardb
cache cache-storage cpp database key-value-store multimodal nosql
Last synced: about 1 month ago
JSON representation
LunarDB is a cache key-value store database made in C++
- Host: GitHub
- URL: https://github.com/kazooki123/lunardb
- Owner: Kazooki123
- License: mit
- Created: 2024-09-14T02:48:04.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-16T10:50:32.000Z (about 1 month ago)
- Last Synced: 2024-11-22T00:00:19.624Z (about 1 month ago)
- Topics: cache, cache-storage, cpp, database, key-value-store, multimodal, nosql
- Language: C++
- Homepage: https://lunardbdocs.vercel.app/
- Size: 53.5 MB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
🌑LunarDB: A cache key-value database
⚡A Cache database⚡
## 🔗What is it?
Lunar is a Key-Value, Cache, Memory based database that loads keys and values in a file when saved by command, you can load this keys and values by the command "LOAD" then filename.
## 📖Documentation
**💫LunarDB** has a documentation website with a guide for users who are new and learning to use LunarDB!
**🌐Visit** [here](https://lunardbdocs.vercel.app/docs/)
## 🔗Commands
**🧭Available commands:**
SET key value [ttl] - Set a key-value pair with optional TTL in seconds.
GET key - Get the value for a key.
DEL key - Delete a key-value pair.
MSET key1 value1 key2 value2 ... - Set multiple key-value pairs
MGET key1 key2 ... - Get multiple values
KEYS - List all keys
HASH SHA256 key - Hashes a key using SHA-256
HASH MURMUR3 key - Hashes a key using the MURMUR3 encryption method
HASH ROTATE input shift - Rotates a hash base on the amount of shifts
CLEAR - Clear all key-value pairs
SIZE - Get the number of key-value pairs
CLEANUP - Remove expired entries
SAVE filename - Save the cache to a file
LOAD filename - Load the cache from a file
LPUSH key value - Push an element to the head of the list
LPOP key - Remove and return an element from the head of the list
RPUSH key value - Push an element to the tail of the list
RPOP key - Remove and return an element from the tail of the list
LRANGE key start stop - Get a range of elements from the list
LLEN key - Get the length of the list
QUIT - Exit the program
## Docker
A **Guide** how to use **LunarDB** using Docker!
### Pull
First, pull the lunardb docker image:
```bash
docker pull kazookilovescoding/lunardb
```### Run it
For running the lunardb docker image:
```bash
docker run kazookilovescoding/lunardb
```And you're done! You should have the **LunarDB** Docker Image in your machine now!
## 🫂Community
**Join** the LunarDB Community!
- [Discord](https://discord.gg/KgxNzAZ5)
## ⚙️Compiling LunarDB
When it comes to Compiling **LunarDB**, there are few methods to compile it
Currently, We use **G++/GCC** for compiling C++ files and then output them as executables!### Important Note
**Note:** You would need:
- The Source codes for **Lua v5.4.4**
- For Linux this would be `liblua5.4-dev` (Ubuntu) and `lua-dev` (Arch)### 🪟Compiling for Windows
**⚠️ LUNARDB IS CURRENTLY ON SUPPORT FOR LINUX FOR NOW SO COMPILING MIGHT BROKE THE MAIN WINDOWS EXE FILE AS `main.cpp` CONTAINS
LINUX-ONLY SYNTAXES FOR LINUX `g++` ⚠️**For Compiling the **LunarDB CLI** in **Windows**, you'll need to downlad [GCC](https://gcc.gnu.org/install/download.html)
Once done and all setup, you can compile the C++ files with this command:```bash
g++ -std=c++17 main.cpp cache.cpp saved.cpp sql.cpp module.cpp hashing.cpp -o ../bin/lunar.exe
```### 🐧Compiling for Linux
To compile **LunarDB** for Linux support, you'll obviously need a **Linux Terminal** for it.
If you are using *Windows*, you'll need to install a **WSL** app (we'll use the Ubuntu WSL for simplicity)Then run this commands:
```bash
sudo apt update
sudo apt install build-essential
```After that, head to "src/" and run this to compile for **Linux** support:
```bash
g++ -std=c++17 main.cpp cache.cpp connect.cpp concurrency.cpp saved.cpp sql.cpp module.cpp hashing.cpp -I/usr/include/lua5.4 -llua5.4 -o ../bin/lunar
```## 🤝CONTRIBUTIONS
Feel free to contribution as it is open for all developers! Just make sure to follow the CONTRIBUTION rules and be respectful.
## ©️LICENSE
LunarDB is under the LICENSE of MIT.