Git Product home page Git Product logo

traildb-sqlite3's Introduction

TrailDB for SQLite

This repository contains an implementation of an extension that exposes TrailDBs as virtual tables in SQLite.

Compile

There is a Makefile in this repository that works on UNIXy systems. Install SQLite and TrailDB first.

    $ make

If compilation is successful, you will have a file sqlite3traildb.so in the current directory that implements the extension.

The Makefile for this project is very simple, since this is a single C-file project. If something fails, the command to compile this extension is not much more than:

    $ gcc -o sqlite3traildb.so sqlite3_traildb.c -O2 -shared -fPIC -ltraildb -lsqlite3

Load

In SQLite, use .load or LOAD_EXTENSION() function to load up the extension.

    sqlite> .load ./sqlite3traildb

To load a TrailDB as a virtual table, invoke CREATE VIRTUAL TABLE:

    sqlite> CREATE VIRTUAL TABLE mytraildb USING traildb ('./path/to/traildb');
    sqlite> SELECT * FROM mytraildb;

Performance

This extension does not implement any indexes or special optimizations when querying TrailDBs. This means most queries will scan the entire TrailDB.

TrailDBs are encoded as integers; this extension will only decode them where necessary. For example, SELECT COUNT(1) FROM tdb will not decode any values to strings.

Unimplemented features

This extension cannot create TrailDBs. It can only read existing TrailDBs.

License

This extension is MIT licensed.

How to contribute

Open issues and pull requests on the project GitHub page.

Contributing to this repository will require a signature on a Contributor License Agreement; we have set up a CLA assistant to make that easy. It will pop up when you open a pull request.

traildb-sqlite3's People

Contributors

noeda avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.