In order to practice C and learn about database internals, I followed this awesome tutorial: (https://cstack.github.io/db_tutorial/)[https://cstack.github.io/db_tutorial/].
The database has a fixed schema of the following format:
Id | Username | |
---|---|---|
uint32 | char[32] | char[255] |
cc db.c -o db
The program requires a file to persist data. Supply a name to create one if it does not exist.
./db mydb.db
Insert a row into the database.
insert 1 user1 person1@example.com
Print all rows in the database
select
.btree
Flush changes to database file and close REPL.
.exit