realm-kotlin
realm-kotlin copied to clipboard
Expose Cores "completely in-memory" mode
Currently our inMemory() modifier still writes files to disk during operation (but it is done lazily and they are removed when the Realm file is closed). However for some use cases, never wanting to write anything will be desirable, like not wanting to deal with crashes potentially leaving files around or preserving SSD drives on devices deployed in the wild that are supposed to be living for many years (and writes will eventually wear them down).
The trade-off is then that cross-process doesn't work at all.
Suggested API:
Configuration.inMemory(mode = <some enum here>)`
This could be introduced as a non-breaking change.
Core seems to support this by just not setting a path in the configuration. This is a bit problematic as Configuration.path is not nullable. Haven't tracked all the implications of this, but might be that we could just mimic this with an empty path = "".