select type_id, name, pretty_name, pretty_plural, tablename, id_column
from pb_types
where pkg_id = :pkg_id
order by sort_order
select name, pretty_name, datatype, column_spec
from pb_attributes
where type_id = :type_id
order by attribute_id
select name as attr_name
from pb_attributes
where type_id = :type_id
order by attribute_id