code: protected <R> R query(Connection tx, String query, QueryFunction<R> function) {
          try (Query q = new Query(objectMapper, tx, query)) {
              return function.apply(q);
          } catch (SQLException ex) {
              throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, ex);
          }
      }
docs: Execute a {@link Query} within the context of a given transaction and return the results of {@literal function}.
  
  @param tx       The transactional {@link Connection} to use.
  @param query    The query string to prepare.
  @param function The functional callback to pass a {@link Query} to.
  @param <R>      The expected return type of {@literal function}.
  @return The results of applying {@literal function}.