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

Support plaintext .sdb files #214

Closed
trufae opened this issue Sep 15, 2020 · 1 comment · Fixed by #219
Closed

Support plaintext .sdb files #214

trufae opened this issue Sep 15, 2020 · 1 comment · Fixed by #219

Comments

@trufae
Copy link
Collaborator

trufae commented Sep 15, 2020

Identify when the .sdb file is k=v in plaintext instead of a disk hashtable in cdb format

This format should be defined somehow in the Sdb instance and saved in the same format when dumping.

@thestr4ng3r
Copy link
Contributor

thestr4ng3r commented Sep 16, 2020

Requirements for the text format:

  • Correctly handle (escape) all valid strings as keys and values, including '=', '\n', '\', etc.
  • Support namespaces somehow

Here is my proposal for a concrete format since I am quite sure the current text k=v is completely broken (# stuff are just comments for explaining but should maybe not be part of the format):

some_key=some_val                             # a record in the root namespace
something\nwith\nnewlines=val\nwith\nnewlines # newlines separate different records, so must be escaped
key\=with\=equals=val=with\=quals             # = must be escaped in the key, but in the value it's optional
key\\with\\backslash=val\\with\\backslash

# completely empty lines are ignored

/subns                                        # lines beginning with '/' and no '=' enter a new namespace (path is always absolute to the root)
key_in_subns=val_in_subns

/subns/deeper                                 # deeper nesting (again, path is absolute)
deepest_key=deepest_val

/weird\=ns\\\nwtf                             # namespace names use the same escaping as keys ...
\/justa_key=henlo                             # except that keys must always escape the first char if it is a slash

/                                             # return to the root namespace (do we want to allow multiple places for a single ns?)
key_in=root

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

Successfully merging a pull request may close this issue.

2 participants