puppetlabs/puppetdb — pull request #979 by senior (2014-05-30 15:08:20+00:00)
Title: (PDB-658) Move facts endpoint to new query engine

This one was a little more messy. Facts currently coerces values to
numbers when using a comparison operator. I have the basics in the query
engine to support this (called "coercible-string"). Other string columns
don't support that (and there are tests ensuring errors are thrown if
users try it). The current code supports both. This also adds <,>,<=, >=
support to the engine, but existing columns that support this need to
have their types changed to number and tests added (will add later).

There's also some additional validations that facts have that others
don't, such as ensuring "not" has only a single clause. There's also a
test around not support nil queries, but really just falls through to
checking that "and" has no empty clauses. I've added those checks to
make the tests pass, but it needs to be reworked once I have my arms
around the checks the other endpoints do.