rom-rb/axiom — pull request #1 by solnic (2014-04-26 13:53:01+00:00)
Title: WIP add #to_ast to relevant objects

As discussed I'm working on adding `#to_ast` to axiom's relations so we could integrate it easily with the new sql generator.

This PR shows current status. Please chime in if you have ideas how the ast should look like. As a good start I'm using mbj's axiom-sexp as an inspiration:

- [ ] Relation::Base => [ :base ]
- [ ] Relation::Materialized => [ :materialized ]
- [ ] Relation::Operation::Order => [ :binary, :order, :operand, :directions ]
- [ ] Relation::Header => [ :collect ]
- [ ] Relation::Operation::Order::DirectionSet => [ :collect ]
- [ ] Relation::Operation::Order::Ascending => [ :unary, :asc, :attribute ]
- [ ] Relation::Operation::Order::Descending => [ :unary, :desc, :attribute ]
- [ ] Relation::Operation::Limit => [ :binary, :limit, :operand, :limit ]
- [ ] Relation::Operation::Offset => [ :binary, :offset, :operand, :offset ]
- [ ] Relation::Operation::Deletion => [ :binary, :delete, :operand, :other ]
- [ ] Relation::Operation::Insertion => [ :binary, :insert, :operand, :other ]
- [ ] Relation::Operation::Reverse => [ :unary, :reverse ]
- [ ] Algebra::Difference => [ :binary, :difference ]
- [ ] Algebra::Extension => [ :extend ]
- [ ] Algebra::Intersection => [ :intersect ]
- [ ] Algebra::Join => [ :binary, :join ]
- [ ] Algebra::Product => [ :binary, :product ]
- [ ] Algebra::Projection => [ :binary, :project, :operand, :header ]
- [ ] Algebra::Rename => [ :binary, :rename ]
- [ ] Algebra::Restriction => [ :binary, :restrict, :operand, :predicate ]
- [ ] Algebra::Summarization => [ :binary, :summarize ]
- [ ] Algebra::Union => [ :binary, :union ]
- [ ] Function::Connective::Conjunction => [ :binary, :and ]
- [ ] Function::Connective::Disjunction => [ :binary, :or ]
- [ ] Function::Connective::Negation => [ :unary, :not ]
- [ ] Function::String::Length => [ :unary, :length ]
- [ ] Function::Predicate::Equality => [ :binary, :eq ]
- [ ] Function::Predicate::Exclusion => [ :binary, :ex ]
- [ ] Function::Predicate::GreaterThan => [ :binary, :gt ]
- [ ] Function::Predicate::GreaterThanOrEqualTo => [ :binary, :gte ]
- [ ] Function::Predicate::Inclusion => [ :binary, :in ]
- [ ] Function::Predicate::Inequality => [ :binary, :neq ]
- [ ] Function::Predicate::LessThan => [ :binary, :lt ]
- [ ] Function::Predicate::LessThanOrEqualTo => [ :binary, :lte ]
- [ ] Function::Predicate::Match => [ :binary, :match ]
- [ ] Function::Predicate::NoMatch => [ :binary, :no_match ]
- [ ] Function::Numeric::Absolute => [ :binary, :abs ]
- [ ] Function::Numeric::Addition => [ :binary, :add ]
- [ ] Function::Numeric::Division => [ :binary, :div ]
- [ ] Function::Numeric::Exponentiation => [ :binary, :exp ]
- [ ] Function::Numeric::Modulo => [ :binary, :mod ]
- [ ] Function::Numeric::Multiplication => [ :binary, :mul ]
- [ ] Function::Numeric::SquareRoot => [ :unary, :sqr ]
- [ ] Function::Numeric::Subtraction => [ :binary, :sub ]
- [ ] Function::Numeric::UnaryMinus => [ :unary, :unary_minus ]
- [ ] Function::Numeric::UnaryPlus => [ :unary, :unary_plus ]
- [ ] Function::Proposition::Tautology => [ :static, :true ]
- [ ] Function::Proposition::Contradiction => [ :static, :false ]
- [ ] Attribute::String => [ :attribute ]
- [ ] Attribute::Integer => [ :attribute ]

NOTES:

* I moved all unit specs to spec-old as I'm not yet sure what to do with them - as I said before I'm no longer a fan of this kind of unit tests and this style of rspec specs. I'll figure it out after I'm done with ast addition
* I'm not going to make rake ci pass as it's too much work so it's very likely this will remain under rom-rb for some time
* My biggest priority is to learn axiom's internals and make it work with the new sql generator and see the whole ROM test suite passing using this fork
* My coding style diverged a little bit from what it used to be so if you see differences and you don't like it tell me and let's discuss it