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

Change key storage format #37

Open
taylorjdawson opened this issue Jul 9, 2018 · 4 comments
Open

Change key storage format #37

taylorjdawson opened this issue Jul 9, 2018 · 4 comments

Comments

@taylorjdawson
Copy link

Issues/Features #36, #31, #35 all hinge on the storage schema of the keys. I am not sure if the current schema would work best with the previously mentioned features.

I like YAML. It is human readable and allows for simple access implementation. It would require an additional module. Also if in the future one wanted to create a 'group' to notify then YAML would facilitate this nicely (see here).

Here is the yaml schema that I propose:

keys:
  asdf: android
  qwer: null
aliases:
  android: asdf

Separating keys and aliases simplifies CRUD operations.

@mashlol
Copy link
Owner

mashlol commented Jul 10, 2018

I like this structure - but I'd love for it to be backward compatible. Perhaps we could read the old txt format first, see if it matches and if so convert over to the yaml format, whenever a key is registered?

Another option, to keep it lightweight, we could just adjust the existing format a bit:

key:alias1,alias2
key2:alias3,alias4

Search time is probably not really a factor in the format, since it's unlikely for anyone to have many aliases/keys

@taylorjdawson
Copy link
Author

Okay! I had already started working on the yaml schema but I can change it back if need be. What do you think about this implementation?

@mashlol
Copy link
Owner

mashlol commented Jul 10, 2018

Yeah looking good! The only thing I don't like that much is that we're writing in a get method, so it has a side effect that may be unexpected. Perhaps simply changing the name to getYamlRegFileOrMigrate or something would be enough to solve that problem.

@taylorjdawson
Copy link
Author

@mashlol okay will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants