You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But, when using get_database only, commenting out the add_database line, wanting to just reopen the stored existing database afterwards without overwriting it with a new (and then empty) one, i get this:
kv_db = env.get_database('kv') File "sophy.pyx", line 251, in sophy.Sophia.get_database KeyError: 'kv'
Is there something i'm doing incorrectly or have misunderstood?
The database schema configuration is not stored in the database, so you have to add the database schema / configure it every time you open the environment. Kinda sucks, not sure if the sophia maintainer has any plans on changing that.
@coleifer Ah ok. Though, unless there's something i've overlooked, it seems to me that add_database will then simply overwrite/replace the pre-existing database, with an empty one.
EDIT: I was mistaken. Not sure how i previously managed to destroy my databases. But add_database does indeed NOT do what i stated above, using the documentation example.
Creating the database works fine using the example given at https://sophy.readthedocs.io/en/latest/api.html#Database , and it's stored to disk. And i can read values to and from it, at that moment.
But, when using get_database only, commenting out the add_database line, wanting to just reopen the stored existing database afterwards without overwriting it with a new (and then empty) one, i get this:
kv_db = env.get_database('kv') File "sophy.pyx", line 251, in sophy.Sophia.get_database KeyError: 'kv'
Is there something i'm doing incorrectly or have misunderstood?
My 'env' folder looks like this:
Any help or tips are appreciated.
The text was updated successfully, but these errors were encountered: