I'm trying to create my own DBMS. For now i want to create a simple one where i can 'create' tables, 'insert' data and do a 'select' for all values(no where condition as of now). Very basic features. This is the first design/pseudo code that i have come up with. I'll be using a .dat file to save data, one file for each table. It will have a 'headerInfo' at the top indicating the columnNames|length (i'm not checking dataType as of now. I'm thinking of using sql style query system which i will parse and confirm syntax, No UI as of now.
Please see this pseudo code and let me know what are the drawbacks/incorrect design or any possible road blocks i'll encounter if i try to extend this.
create a new file for the table
create a 'table_header_info' which is delimited string of columns|length
insert header info at top of file.
insert the table_name-fileName entry in 'm_objectDictionary'
validate number of values and size of each column against length
if validations are fine
open the file.
create object of 'table' class using tablename
load the corresponding file using tablename from m_objectDictionary
read the file
format and display contents
i know its not very clear, probably i'll post some code when i'm done.