Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

schema compatibility hard to verify, currently not verified #201

Open
seebs opened this issue Nov 29, 2018 · 0 comments
Open

schema compatibility hard to verify, currently not verified #201

seebs opened this issue Nov 29, 2018 · 0 comments
Assignees

Comments

@seebs
Copy link
Contributor

seebs commented Nov 29, 2018

schema.Index() and index.Field() are both get-or-create methods, but that means that if you specified options, you don't necessarily know that the options you specified are the same as the options already present.

In some cases, empty/default options promote to non-zero-value options, so it's not necessarily possible to trivially check whether the set of options in the schema returned by the server is incompatible with or different from user-specified options. The key weak points are the FieldTypeDefault and CacheTypeDefault values; for instance, if you explicitly specify a CacheType of "", you will end up with the default cache type of "ranked", but not until the field options are transmitted to the server, and the schema is queried again. (SyncSchema won't update the local copy to reflect this.)

Since these functions don't return errors, and haven't previously returned nil, it's unclear how to safely change the API for this. Don't have a good plan, filing issue so it doesn't get forgotten.

@yuce yuce self-assigned this Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants