This is my attempt on implementing the sqlite cli from scratch based on codecrafters's "Build Your Own SQLite" Challenge.
Right now it supports the following dot commands:
- .dbinfo
It outputs the size of the database pages and the number of rows in sample.db. - .tables
Display all tables registered atsqlite_schema.
- At
.dbinfothe size of tables was achieved only using the first page's row counting. This solution will output the incorrect solution if there are triggers or indexes in thesqlite_schematable. To fix this, I believe we have to walk through the sqlite_schema rows counting every row with type table. - At
.tablesthe payload implementation do not take into account the possibility of the sqlite_schema having overflow pages, so the solution is only 90% complete.