A simple sqlite-like database written in C
To practice C after a 8 year hiatus, I'm building small projects in the language. It's a rough and dirty data store but serves to improve my grasp on C.
Here's the NachoDB prompt:
nacho >
NachoDB has a single table with a fixed schema:
| id | username | |
|---|---|---|
| int | varchar(255) | varchar(255) |
The records look like this:
| id | username | |
|---|---|---|
| 0 | John | jdoe@gmail.com |
| 1 | Dave | dsmith@gmail.com |
| 2 | Jerry | jwang@gmail.com |
Here are some useful commands:
insertselect.exit
To see the bytes being stored on the disk, go to the src directory and type the following in terminal:
vim rishtest.nacho
:%!xxdThis allows us to see the individual bytes and the corresponding data.
MIT