Home

Awesome

axiom-sql-generator

Relational algebra SQL generator

Gem Version Build Status Dependency Status Code Climate Coverage Status

Usage

# visit every node in the relation AST
generator = Axiom::SQL::Generator::Relation.visit(relation)

# generate an SQL string
sql = generator.to_sql

# generate an SQL subquery string
subquery_sql = generator.to_subquery

Description

The purpose of this gem is to produce valid SQL from a axiom relation. A relation is a representation of a query constructed using relational algebra organized into an AST. Each node in the AST corresponds to an operation defined in the algebra.

The SQL produced has been verified and tested against PostgreSQL 9.0.4. Dialects for MySQL, SQLite, Oracle and SQL Server are planned.

Contributing

See CONTRIBUTING.md for details.

Copyright

Copyright © 2010-2013 Dan Kubb. See LICENSE for details.