All Projects → facebookincubator → Cg Sql

facebookincubator / Cg Sql

Licence: mit
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.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Cg Sql

Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+1002.38%)
Mutual labels:  sql, sqlite
Oreilly getting started with sql
Database files for the O'Reilly book "Getting Started with SQL: A hands on approach for beginners" http://goo.gl/z3zG54
Stars: ✭ 156 (-25.71%)
Mutual labels:  sql, sqlite
Oreilly intermediate sql for data
Resources for the O'Reilly Online Training "Intermediate SQL For Data Analysis"
Stars: ✭ 136 (-35.24%)
Mutual labels:  sql, sqlite
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-39.52%)
Mutual labels:  sql, sqlite
Geopackage Js
GeoPackage JavaScript Library
Stars: ✭ 191 (-9.05%)
Mutual labels:  sql, sqlite
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+905.71%)
Mutual labels:  sql, sqlite
Atdatabases
TypeScript clients for databases that prevent SQL Injection
Stars: ✭ 154 (-26.67%)
Mutual labels:  sql, sqlite
Sqhell.vim
An SQL wrapper for vim
Stars: ✭ 113 (-46.19%)
Mutual labels:  sql, sqlite
Nut
Advanced, Powerful and easy to use ORM for Qt
Stars: ✭ 181 (-13.81%)
Mutual labels:  sql, sqlite
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+952.86%)
Mutual labels:  sql, sqlite
Rbql
🦜RBQL - Rainbow Query Language: SQL-like language for (not only) CSV file processing. Supports SQL queries with Python and JavaScript expressions
Stars: ✭ 118 (-43.81%)
Mutual labels:  sql, sqlite
Better Sqlite3
The fastest and simplest library for SQLite3 in Node.js.
Stars: ✭ 2,778 (+1222.86%)
Mutual labels:  sql, sqlite
Sqlite3 To Mysql
Make an Sqlite3 export MySQL readable.
Stars: ✭ 116 (-44.76%)
Mutual labels:  sql, sqlite
Askgit
Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊
Stars: ✭ 2,707 (+1189.05%)
Mutual labels:  sql, sqlite
Sql Kit
*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
Stars: ✭ 115 (-45.24%)
Mutual labels:  sql, sqlite
Efcore.bulkextensions
Entity Framework Core Bulk Batch Extensions for Insert Update Delete Read (CRUD), Truncate and SaveChanges operations on SQL Server, PostgreSQL, SQLite
Stars: ✭ 2,295 (+992.86%)
Mutual labels:  sql, sqlite
Contacts
A flutter project with Implementation of a Contacts app in 4 ways (API, Custom, Preferences and Sqflite).
Stars: ✭ 100 (-52.38%)
Mutual labels:  sql, sqlite
Minisqlquery
Minimalist SQL Query tool for any .NET DB Provider - SQL, SQLite, SQL CE, Oracle, Access...
Stars: ✭ 103 (-50.95%)
Mutual labels:  sql, sqlite
Rom Sql
SQL support for rom-rb
Stars: ✭ 169 (-19.52%)
Mutual labels:  sql, sqlite
Trilogy
TypeScript SQLite layer with support for both native C++ & pure JavaScript drivers.
Stars: ✭ 195 (-7.14%)
Mutual labels:  sql, sqlite

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.

From a bare Ubuntu installation, you might need to add these components:

sudo apt install

  • make
  • gcc
  • flex
  • bison
  • sqlite3
  • libsqlite3-dev

After which I was able to do the normal installations.

For the coverage build you need

  • gcovr

And if you want to do the AST visualizations in PNG form you need

  • graphviz

Options

  • If you add CGSQL_GCC to your environment the Makefile will add `CFLAGS += -std=c99 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 docs/dev_notes.md for workflow tips

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].