A simple one-user single-thread database as a final project.
flex
>= 2.5.31bison
>= 3.0.4
On unix-like systems, type
$ make
./mydb [-s port | -r addr -p port | -f file | -h]
Options:
-s start as server
-r connect remote server (ip)
-p connect remote server (port)
-f specify input SQL file
-h see help
To launch interactive terminal, run without any options.
Type
./mydb
You will see the following welcome information
Welcome to mydb!
Powered by Wen He and Zhu Fengmin.
Type SQL statements end with ';' or type 'exit' or 'quit' to quit.
Run './mydb -h' to see more options.
mydb>
Type SQL statements to execute queries
mydb> show databases;
Or type exit
or quit
to quit mydb
mydb> exit
Type
./mydb -f <your_input_file_name>
then you can see the results.
First start a server
./mydb -s <port>
Then connect the server
./mydb -r <ip> -p <port>
And you can now using it in interactive environment.
See SQL Support Document for more information.
See Final Report. Notice that it is written in Chinese.