-
Supported DDL commands:
CREATE TABLEDROP TABLEALTER TABLESHOW TABLE
-
Supported DML commands:
SELECTINSERTUPDATEDELETE
-
Extra Commands:
SHOW PATHEXIT
- Each table is stored as a CSV file in a
/datadirectory. - A metadata file (e.g.,
schema.jsonortables.meta) describes columns and data types.
Implement classes for reading and writing CSV files safely.
- Load a table from CSV.
- Write table data back to CSV after modifications.
- Perform basic type validation and parsing.
- Run functional tests with real commands:
- Create tables, insert data, and perform queries.
- Validate correct CSV updates and metadata consistency.
- Add syntax validation and user-friendly error messages.
- Handle invalid column names, data types, and file errors safely.
Below is an example of how the program might look when running in the terminal:
Welcome to MiniSQL-CPP!
Type "exit;" to quit.
sql> SHOW TABLES;
No tables found.
sql> CREATE TABLE students (id INT, name TEXT, grade FLOAT);
Table "students" created successfully.
sql> INSERT INTO students VALUES (1, 'Alice', 3.9);
1 row inserted.
sql> INSERT INTO students VALUES (2, 'Bob', 3.5);
1 row inserted.
sql> SELECT * FROM students;
+----+-------+-------+
| id | name | grade |
+----+-------+-------+
| 1 | Alice | 3.9 |
| 2 | Bob | 3.5 |
+----+-------+-------+
2 rows returned.
sql> UPDATE students SET grade = 4.0 WHERE name = 'Alice';
1 row updated.
sql> DELETE FROM students WHERE id = 2;
1 row deleted.
sql> SELECT * FROM students;
+----+-------+-------+
| id | name | grade |
+----+-------+-------+
| 1 | Alice | 4.0 |
+----+-------+-------+
1 row returned.
sql> DROP TABLE students;
Table "students" dropped.
sql> exit;
Goodbye!