Skip to content

guiji101/CMU-Database

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

15-445-645 Database Systems

SQLite Project Source Code

This is the project of CMU 15-445/645, you will find the inital code on the first initial commit.

Course Website

https://15445.courses.cs.cmu.edu/fall2018/syllabus.html

Duild

mkdir build
cd build
cmake ..
make

Debug mode:

cmake -DCMAKE_BUILD_TYPE=Debug ..
make

Testing

cd build
make check

Run virtual table extension in SQLite

Start SQLite with:

cd build
./bin/sqlite3

In SQLite, load virtual table extension with:

.load ./lib/libvtable.dylib

or load libvtable.so (Linux), libvtable.dll (Windows)

Create virtual table:
1.The first input parameter defines the virtual table schema. Please follow the format of (column_name [space] column_type) seperated by comma. We only support basic data types including INTEGER, BIGINT, SMALLINT, BOOLEAN, DECIMAL and VARCHAR.
2.The second parameter define the index schema. Please follow the format of (index_name [space] indexed_column_names) seperated by comma.

sqlite> CREATE VIRTUAL TABLE foo USING vtable('a int, b varchar(13)','foo_pk a')

After creating virtual table:
Type in any sql statements as you want.

sqlite> INSERT INTO foo values(1,'hello');
sqlite> SELECT * FROM foo ORDER BY a;
a           b         
----------  ----------
1           hello   

See Run-Time Loadable Extensions and CREATE VIRTUAL TABLE for further information.

Virtual table API

https://sqlite.org/vtab.html

About

This is the project of CMU 15-445/645. Video on Fall 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 89.9%
  • Makefile 4.6%
  • C++ 4.5%
  • Other 1.0%