sql-bricks can write queries for us, and the mapper handles type conversions to and from SQL-friendly strings.