quick and dirty first pass on generating foreign tables