     sql = """
       SELECT *
       FROM #{operations_table}
-      WHERE "v" BETWEEN ? AND ?
-      AND "doc" = ?
-      ORDER BY "v" ASC
+      WHERE v BETWEEN ? AND ?
+      AND doc = ?
+      ORDER BY v ASC
     """
     values = [start, end, docName]
     client.query sql, values, (error, result) ->

    sql = """
      SELECT *
      FROM #{snapshot_table}
      WHERE "doc" = ?
      ORDER BY "v" DESC
      LIMIT 1
    """
    values = [docName]

    sql = """
      UPDATE #{snapshot_table}
      SET ?
      WHERE doc = ?
    """
    values =
      v:        docData.v
