https://github.com/jeninsutradhar/hexadb
An AI-powered in-memory relational database system that supports SQL-like operations, enhanced with AI-based natural language processing
https://github.com/jeninsutradhar/hexadb
ai-powered database db json natural-language-processing nlp sql
Last synced: 6 months ago
JSON representation
An AI-powered in-memory relational database system that supports SQL-like operations, enhanced with AI-based natural language processing
- Host: GitHub
- URL: https://github.com/jeninsutradhar/hexadb
- Owner: JeninSutradhar
- Created: 2025-03-29T09:00:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-03-29T11:35:22.000Z (6 months ago)
- Last Synced: 2025-04-11T00:13:25.301Z (6 months ago)
- Topics: ai-powered, database, db, json, natural-language-processing, nlp, sql
- Language: C++
- Homepage: https://hexadb.vercel.app
- Size: 279 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
Awesome Lists containing this project
README
![]()
A very simple and Fast **in-memory** database implemented in **C++**.
## Description
HexaDB is a basic command-line database system that supports creating tables, inserting, selecting, updating, and deleting rows. It also supports indexing and saving/loading databases to/from files.
## Compilation and Running
To compile and run the code, you'll need a C++ compiler that supports C++17 (or later). g++ is recommended.
```bash
g++ -o hexadb main -std=c++17
./hexadb
```# Architecture
## Features
* **Tables:** Create and manage tables with columns of type INT, TEXT, or REAL.
* **CRUD Operations:** Supports INSERT, SELECT, UPDATE, and DELETE operations with basic WHERE clause filtering.
* **Indexing:** Create indexes on columns to potentially speed up queries.
* **Persistence:** Save and load databases to/from files.
* **SQL:** Interact with the database using SQL-like commands.## Example Usage
```sql
CREATE TABLE users (id INT, name TEXT, age INT);
INSERT INTO users (id, name, age) VALUES (1, 'Alice', 30);
INSERT INTO users (id, name, age) VALUES (2, 'Bob', 25);
SELECT * FROM users;
SELECT name, age FROM users WHERE age > 28;
UPDATE users SET age = 31 WHERE name = 'Alice';
DELETE FROM users WHERE id = 2;
PRINT TABLE users;
SAVE DB my_database.data
LOAD DB my_database.data
```Type `help` in the HexaDB terminal for a list of commands. Type `exit` to quit.