https://github.com/iTwin/imodel-transformer/blob/cc7c3fade07b7cf49c3920acc0af4170c17793e0/packages/transformer/src/ECReferenceTypesCache.ts#L121C1-L133C1
Changes:
- Use schema context on IModelDb so schemas are only loaded once and reused for life time of IModelDb connection
- Modify query so schema names are only returned once
- order is no longer necessary for loading when using SchemaContext, is it necessary for init code? If not remove ordering, if so ordering is incorrect as ordering by ECInstanceId of ECSchemaDef does not provide correct order IF references change in schema updates
Consider:
- How existing test coverage can be improved
- Performance testing
- Potential to replace schema traversal logic with one or more queries
- Using updated ecschema-metadata APIs to get items of a type and to determine type without using instance