Skip to content

bathan1/vttp

Repository files navigation

vttp

An HTTP backed virtual table for SQLite.

OS Arch Tested
Linux x64
Linux arm64
macOS x64
macOS arm64
Windows x64
Windows arm64

Building

To build using the Makefile, you need the following libraries installed onto your system lib: - yajl for stream parsing. - yyjson to be able to work with JSONs in C without going insane. - libcurl to parse URLs. - SQLite (duh!)

To install yajl and libcurl Ubuntu, for example:

sudo apt install libsqlite3-dev openssl libcurl4-openssl-dev libyajl-dev

yyjson isn't available on apt, so we have to build from source:

git clone https://github.com/ibireme/yyjson
cd yyjson
mkdir build && cd build && cmake ..
sudo make install

Then cd back into the root and run to build the extension file libvttp.so:

make

And that's it!

Other Scripts

To install / uninstall the VTTP API header vapi.h from your usr local lib:

sudo make install
sudo make uninstall

To run the test script, make sure you have the binary built at the project root. Then you can run the npm script:

pnpm run test

Library

The majority of the code is under src/lib, where a select number of functions are exposed to the extension vttp.c file via the vapi.h header.

If you've installed the API via the make install command, you can use the helper functions in standalone code by compiling with the -lvapi flag. To compile the queue printer example script:

gcc stream_print.c -lvapi

Documentation

This project uses Doxygen for code documentation and uses Docusaurus for the tutorial docs.