Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec: globbing problems #2634

Open
kodebach opened this Issue Apr 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@kodebach
Copy link
Contributor

kodebach commented Apr 14, 2019

The spec plugin doesn't do globbing correctly:

  • The # glob should query the array size and should copy metadata to non-existent keys within the array bounds as well. Otherwise something like kdb get array/#0 won't work, even if the specification contains a default value for array/#. Setting the fallback metadata might also be a solution.
  • The same problem exists for _, however, I don't really see a solution there, because you can't create all possible keys.

Where possible, the spec plugin should also use the globbing library.

@markus2330 markus2330 referenced this issue Apr 14, 2019

Open

spec: make more expressive #2632

0 of 3 tasks complete
@markus2330

This comment has been minimized.

Copy link
Contributor

markus2330 commented Apr 15, 2019

The same problem exists for _, however, I don't really see a solution there, because you can't create all possible keys.

I am not sure if we really need this?

We could provide the (real) parentKey to the plugins. Then spec would know which key to create. This would of course not help for every applications but only for something like kdb get.

@tom-wa always wanted the (real) parentKey for the multiresolver, so that not all files need to be loaded in kdbGet.

Where possible, the spec plugin should also use the globbing library.

I fully agree.

@kodebach

This comment has been minimized.

Copy link
Contributor Author

kodebach commented Apr 15, 2019

We could provide the (real) parentKey to the plugins.

What do yo mean by that? And how would that solve the problem? Take for example this specification. Specifically the key menu/menu/_/displayname.

The intention was that for every menu there would be a named entry under menu/menu/. But if you try to lookup menu/menu/test/displayname, the spec plugin would magically have to know in advance to create this key. Obviously this can't work (and that should be mentioned in the docu), but it should work, if menu/menu/test exists. That however is also not the case right now.

What would also work is using # instead of _ (once the bug is fixed).

Basically, right now the globbing in spec is only useful for kdbSet() calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.