-
Notifications
You must be signed in to change notification settings - Fork 123
ksLookup options #4222
Comments
No, you are right, we can remove that flag in the public API if we have a proper replacement for KDB_O_POP.
I agree.
As also ksCut and many others could have a ByName variant, we need to watch out that libelektra-operations doesn't get too fat. |
Which flags can be removed? All of them? I didn't even mention
You agree, it should be core API or you agree it should be removed?
|
With your sentence "It's not really minimal, so it might be better as a part of the proposed libelektra-operations?" i.e. I agree moving it to libelektra-operations.
Yes, a good architecture for these supporting libraries is still missing. |
See #4245 for a suggestion. |
Related to #3979 and possibly as another part of #4201, we should think about which options of
ksLookup
are actually still relevant.The available options are as follows:
KDB_O_DEL
: not necessary, but useful option, if the key isn't needed afterwards, butksLookupByName
wasn't an optionKDB_O_CREATE
: not necessary, but useful option, if the key is needed afterwards, but might not exist yetKDB_O_SPEC
: not really sure why this exists or what purpose it servesKDB_O_NOSPEC
: AFAICT only used internally to avoid recursion; shouldn't be supported by public APIKDB_O_NOCASCADING
: might make sense for testing and internal use, but shouldn't be supported by public APIKDB_O_NODEFAULT
: might make sense for testing and internal use, but shouldn't be supported by public APIKDB_O_CALLBACK
: AFAICT only used for themeta:/callback
metadata; shouldn't be supported by public APIKDB_O_OPMPHM
: might make sense for testing and internal use, but shouldn't be supported by public APIKDB_O_BINSEARCH
: might make sense for testing and internal use, but shouldn't be supported by public APISo this leaves only
KDB_O_DEL
andKDB_O_CREATE
for the public API. They are surely nice to have, but at this point the question is: Do we need them? Is this minimal?Two tangentially related questions that might need their own issue:
ksLookupByName
be core API? It's not really minimal, so it might be better as a part of the proposedlibelektra-operations
?elektraLookupBySpec
be part of the core, or should we usemeta:/callback
to get a callback into thespec
plugin?The plugin can then process
meta:/fallback
etc. and return the correct key. I think with such a callback we could also handle#
and_
wildcards much better. In fact,spec
might (optionally) be able to do all processing lazily upon lookup.The main benefit of this change would be that alternative implementations (e.g. Rust) don't need to duplicate this lookup procedure. They just need to know about the cascading order and call any
meta:/callback
s.The text was updated successfully, but these errors were encountered: