Updating table generators to use QueryContext