Skip to content

A simple DBMS developed using C, also an education material of Intro to DBMS in National Chiao Tung University

License

Notifications You must be signed in to change notification settings

Billy4195/simple_DBMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple DBMS

This project is a simple DBMS implemented using C, as the education material of the Introduction to Database Systems in National Chiao Tung University

Prerequisite

  • make >= 4.1
  • gcc >= 5.4.0
  • g++ >= 5.4.0
  • gtest >= 1.8.1
  • python >= 3.6.0

Unit test

$ make check

System test

$ python3 test/system/system_test.py ./shell [test_case..]

if no test_cases is specified, it will run all system tests by default

Compile

$ make

Quick Start

$ ./shell

Query

The current table schema is hard coded, the schema in the include/User.h, you can check the User_t to get the detail of each field.

Table schema

User table

field_name data_type
id int
name char[255]
email char[255]
age int

Supported command

Command Description
insert The insert command only allow insert one User_t record at a time
select The select command will only print out all the User_t records in the current databases

Storage mode

Memory only

The memory only will not store any record after the process terminate

Usage:

$ ./shell

File mode

The File mode will store the record into the specify <DB file>, the next execute can automatically reload the record by the same execution command.

Usage:

$ ./shell <DB file>

Project Layout

├─ include/           Header files
├─ src/               Source files
│  ├─ shell.c         Entry point, which contains main()
│  └─ Util.c          Some utility functions
├─ test/              Unit tests & system tests
│  ├─ include/        Test header files
│  ├─ system/         System tests
│  └─ *.c             Unit tests source file
└─ Makefile           Makefile for make

About

A simple DBMS developed using C, also an education material of Intro to DBMS in National Chiao Tung University

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published