Make the current hack for SqlTables more general.