Fix the quoting on type_alias

The manner in which the type_alias lookup is being assembled is rather lousy and has hardcoded `'` style quoting which is not database agnostic.  This PR cleans that mess up.