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

Paths and how to work with it? #49

Open
Gavolot opened this issue Feb 5, 2024 · 5 comments
Open

Paths and how to work with it? #49

Gavolot opened this issue Feb 5, 2024 · 5 comments

Comments

@Gavolot
Copy link

Gavolot commented Feb 5, 2024

It's not exactly a mistake. But I read the documentation and didn’t understand anything about how to work with them.

Your library is working. But I don’t understand how I can, for example, “delete” the database for tests.

Because now I can’t do this, because I don’t know where it is in Windows. I'm exclusively making a PC game.

@Gavolot
Copy link
Author

Gavolot commented Feb 5, 2024

It's important to clarify, I'm relatively new to Rust, but not new to programming.

@johanhelsing
Copy link
Owner

The point of this library is that you should not have to think about paths, it's just created in the right directory.

There is a clear method, does this do what you want to do?

On windows, the db is created somewhere inside appdata

@Gavolot
Copy link
Author

Gavolot commented Feb 7, 2024

yes, I wanted to simulate a situation where the “User” deleted the database or decided to transfer the “saves” to another computer

@Gavolot
Copy link
Author

Gavolot commented Feb 8, 2024

I found where it is by default in Windows. I had already forgotten that Windows has a “recently changed” filter and the ability to sort by date.

My last question is, can I somehow force the database to be saved in the game's .exe directory?

@johanhelsing
Copy link
Owner

johanhelsing commented Feb 8, 2024

Hmm... have you considered just using redb directly? Apart from figuring out the correct paths for your platform and serialization, this crate adds very little on top. It's intended as a zero configuration-needed crate.

But yeah, you could create it in a specific directory: https://docs.rs/bevy_pkv/latest/bevy_pkv/struct.PkvStore.html#method.new_in_dir

See https://github.com/johanhelsing/bevy_pkv/blob/main/src/redb_store.rs if you'd rather use redb directly.

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