I'm more of a fan of Datomic's query language than SQL's. It's much easier to parameterize, you can manipulate it as a data structure rather than a raw string, and you can easily ask questions about what the database knew at a specific time. The "as-of" function lets you get the value of the database at a specific time, and the queries you are already writing anyways are against the current value of the database, so it's easy to compare the two.