Git Product home page Git Product logo

cybernetics / cg-sql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebookincubator/cg-sql

0.0 1.0 0.0 2.28 MB

CG/SQL is a compiler that converts a SQL Stored Procedure like language into C for SQLite. SQLite has no stored procedures of its own. CG/CQL can also generate other useful artifacts for testing and schema maintenance.

License: MIT License

HTML 53.62% Shell 1.71% Makefile 0.01% C 34.11% Lex 0.46% Yacc 2.40% Objective-C 0.04% C++ 0.09% JavaScript 0.91% Python 0.32% TSQL 6.16% Java 0.16%

cg-sql's Introduction

Licensing

See LICENSE in the root directory

Documentation

See CQL_Guide/guide.html for the language summary.

Building

With requirements met (see below)

make clean
make

This puts the result in out/cql

Requirements

The default bison on Mac is quite old (v2.3). You'll need to replace it. The Build produces an error if this is happening. You can get a more recent bison like this:

  brew install bison
  brew link bison --force

The default SQLite on Ubuntu systems is also fairly old. Some of the tests (particularly the query plan tests) use features not available in this version. You'll want to link against a newer sqlite to pass all the tests.

Options

  • If you add CGSQL_GCC to your environment the Makefile will add CFLAGS += -std=c99 -D_Nullable= -D_Nonnull= to try to be more interoperable with gcc.

  • If you add SQLITE_PATH to your environment the Makefile will try to compile sqlite3-all.c from that path and it will link that in instead of using -lsqlite3.

Testing

./test.sh

This will build and run the test suite

./test.sh --use_amalgam

Does the same thing but it tests the built amalgam rather than the normal build

Code Coverage

./cov.sh

This will run the test scripts with the coverage flag, which causes the coverage build. If the tests pass a coverage report is created.

The same build options are available as cov.sh uses test.sh to do the heavy lifting.

Amalgam Build

The amalgam is created by ./make_amalgam.sh and the result is in out/cql_amalgam.c

You can create and test the amalgam in one step (preferred) using

./test.sh --use_amalgam

This will cause the amalgam to be created and compiled. Then the test suite will run against that binary.

Dev Cycle

See dev_notes.md for workflow tips

cg-sql's People

Contributors

facebook-github-bot avatar mingodad avatar ricomariani avatar

Watchers

 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.