dkubb/axiom-sql-generator

View on GitHub
TODO

Summary

Maintainability
Test Coverage
* Replace some of the conditional function with polymorphism, especially
  where there is special case function for certain types of generators
  within other generators.
  * Replace Equality/Inequality with classes that handle all of the
    special cases.
  * Use different classes for inclusive/exclusive Range literals so that
    they can be serialized to SQL differently.
    * Create Axiom::Literal::Range proxy object w/factory method
    * Create Axiom::Literal::Range::Inclusive
    * Create Axiom::Literal::Range::Exclusive

* Handle cases where an Inequality/Exclusion predicate is used (or a
  Negation wrapping an Equality/Inclusion) on an *optional* attribute.
  * Add "OR attribute IS NULL" to the statement to ensure cases when
    the value is NULL still matches.

* Handle case where Inclusion/Exclusion predicate enumerable contains a nil value.
  * Remove the nil value from the enumerable.
  * If the attribute is *optional*, change query so that "OR attribute IS * NULL"
    is added to the output statement.

* Handle cases where WHERE clause does and does not reference a function
  in the SELECT list.
  * It should collapse the inner subquery when there is no reference, and
    keep the subquery when it is referenced.
  * This will likely apply to projection and rename operators too.

* When Restriction wraps a Summarization, and it would normally wrap the
  statement and apply a WHERE clause, it should apply the clause using
  HAVING instead.

* Handle case where Extension does not reference a column in the
  wrapped Summarization or Rename. It should be safe to collapse the query
  in those cases.