Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NanoSQL

A lightweight, C++17-based SQL engine built for learning and experimentation.
Supports basic SQL operations: CREATE, INSERT, SELECT, UPDATE, DELETE, DROP with simple WHERE conditions.

🚀 Features

  • Table creation with INT and TEXT columns
  • CRUD operations (Insert, Select, Update, Delete)
  • Condition filtering (=, <, >, >=, <=)
  • Command-line interface with history (.exit to quit)

🛠️ Build

Clone the repo and build with CMake:

git clone https://github.com/your-username/NanoSQL.git
cd NanoSQL
mkdir -p build && cd build
cmake ..
make

This produces the executable nanosql (and test binaries test_lexer, test_parser, test_condition).
▶️ Usage

Start the database:
bash

./nanosql

You'll see a prompt:
text

nanosql>

Example session
sql

CREATE TABLE users (id INT, name TEXT, age INT);

INSERT INTO users VALUES (1, 'Alice', 30);
INSERT INTO users VALUES (2, 'Bob', 25);
INSERT INTO users VALUES (3, 'Charlie', 35);

SELECT * FROM users;
-- id | name    | age
-- 1  | Alice   | 30
-- 2  | Bob     | 25
-- 3  | Charlie | 35

SELECT name, age FROM users WHERE age > 28;
-- name    | age
-- Alice   | 30
-- Charlie | 35

UPDATE users SET age = 31 WHERE id = 1;

DELETE FROM users WHERE id = 3;

DROP TABLE users;

.exit

📦 Supported Data Types

    INT – integer numbers

    TEXT – string values (use single quotes: 'hello')

🧪 Running Tests

After building, run the test executables:
bash

./test_lexer
./test_parser
./test_condition

📄 License

MIT – feel free to use and modify.

    Built as a learning project – happy querying! 🎉

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages