add max() to TableGateway