pedrogao / simplesql

simple sql database implement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simplesql

simple sql database implement

pre-requirements

sql-parser:

cd third_party && git clone https://github.com/hyrise/sql-parser
cd sql-parser && make
cp libsqlparser.so /usr/local/lib

spdlog:

cd third_party && git clone https://github.com/gabime/spdlog.git
cd spdlog && mkdir build && cd build
cmake .. && make -j 4
cp libspdlog.a /usr/local/lib

wfrest:

cd third_party && git clone https://github.com/wfrest/wfrest
cd wfrest && make
make install

startup

build sql server and run:

$ mkdir build && cd build
$ cmake ..
$ make -j4 spsql_d

$ ./bin/spsql_d test.db
[2022-06-05 13:08:01.755] [debug] init sql db at test.db
2022-06-05 13:08:01 [Users/pedrogao/projects/cpp/simplesql/src/include/concurrency/lock_manager.h:67:LockManager] INFO  - Cycle detection thread launched
[2022-06-05 13:10:43.436] [info] req body size : 69
[2022-06-05 13:10:43.438] [debug] create table: students

post sql query:

$ curl  -X POST -d 'CREATE TABLE students (name VARCHAR(20), age INTEGER, grade INTEGER);' http://localhost:8888

execute successful!%

thanks

BusTub

About

simple sql database implement

License:MIT License


Languages

Language:C++ 95.0%Language:Python 2.6%Language:CMake 1.5%Language:Shell 0.9%Language:Dockerfile 0.0%