meilisearch / heed

A fully typed LMDB wrapper with minimum overhead 🐦
https://docs.rs/heed
MIT License
569 stars 52 forks source link

expose mdb_env_set_flags() #202

Closed mikedilger closed 1 year ago

mikedilger commented 1 year ago

During migrations, I want to set NO_SYNC | NO_META_SYNC. (yes I try to do it as one transaction anyways)

Kerollmops commented 1 year ago

Isn't the EnvOpenOptions::flag method not enough? It is available on the 0.20.0-alpha versions.

mikedilger commented 1 year ago

So do I open a separate env? And can I do that while I still have another env already open (I open the env originally in a lazy static)? and then it seems I'd have to open all the database again too. Lots of calls to use EnvOpenOptions.

Kerollmops commented 1 year ago

Could you describe what you would like to do? If I had to open an env with specific options, I would use the EnvOpenOptions to set up the flags and use it the whole program. Are you trying to change the environment options when the env is already opened? If so, you could close it with the Env::prepare_for_closing method and reopen it afterward.

mikedilger commented 1 year ago

I'm no longer doing this. I was opening it without these options and syncing every transaction, then during certain sequences I wanted it to not sync every transaction. Now I'm manually handling the syncing.