gravity: Add support for conditional statements to SQLite3 query builder