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

Keyfile Path only in root directory #25

Closed
schmurian opened this issue Aug 24, 2021 · 3 comments
Closed

Keyfile Path only in root directory #25

schmurian opened this issue Aug 24, 2021 · 3 comments

Comments

@schmurian
Copy link

Hi,

I've tried to create a new database in secure mode and wanted to move both files into a subdirectory
db = elara.exe_secure("path/new.db", "path/newdb.key")
While the db file was created in the subdirectory, the keyfile wasn't accepted as argument which resulted in 'edb.key' being created in the root directory.

It would be great if this could be fixed. (If this is on purpose, please share the reasons for this decision. Curious!)

Thank you for this great app!

@saurabh0719
Copy link
Owner

saurabh0719 commented Aug 25, 2021

Hi @schmurian

Thank you for pointing this out! This is indeed an issue, as the arguments can't be skipped, and hence this is a mistake in the Elara documentation!

I'd suggest trying something like this :

import elara

db = elara.exe_secure(path="path/new.db",  key_path="path/edb.key")  

db.set("num", 20)
print(db.get("num"))

This should solve the issue for you. By default commitdb is False. If you would like to change that you can do the following :

option-1

db = elara.exe_secure(path="path/new.db",  commitdb=True, key_path="path/edb.key") 

OR

option-2

db = elara.exe_secure("path/new.db", True, "path/edb.key") 

I intend to extend Elara further and add more extensions/arguments hence I suggest you go with option-1 over option-2 if you're maintaining any long term code base, so as to stay unaffected by any future updates.

Hope this helps :). I will update the documentation with the same very soon. Thanks again for pointing this out!

@schmurian
Copy link
Author

Ah, yes! Thank you! That does the trick.
Great, looking forward to upcoming updates!

@saurabh0719
Copy link
Owner

Cheers!

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

No branches or pull requests

2 participants