You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A discussion in #109 suggest distinguishing between a resource.IndexBuilder (allows adding resources, and returning a compiled index) and resource.Index (allows finding active resources and fetching items).
There are some reasons that could make it worthwhile to take a similar approach for schema.Schema:
FieldValidors are often referred to as pointers (e.g. schema.IDField, to mention one). When the Field definition is reused in multiple schemas, or the same schema is compiled multiple times in parallel, e.g. for tests, a data race condition arise. When CIs run the tests with race detection enabled, they are likely to fail.
We won't be able to accidentally use an uncompiled schema in place of a compiled one.
This changes should be considered alongside other potentially large schema package changes, such as #77, that basically suggests allowing any FieldValidator to be used a the Schema top-level.