Add H2 support to grouping and query utility