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

Add support for RealmConfiguration.initialRealmFile() #577

Closed
sync-by-unito bot opened this issue Nov 22, 2021 · 3 comments · Fixed by #1359
Closed

Add support for RealmConfiguration.initialRealmFile() #577

sync-by-unito bot opened this issue Nov 22, 2021 · 3 comments · Fixed by #1359
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Nov 22, 2021

Similar to Realm Java we should support shipping bundled Realm files.

Proposed API:

// Path to file...semantics might differ based on target
RealmConfiguration.Builder.assetFile(path: String)

Since bundling files are different across platforms, this might be slightly tricky to do across all platforms, e.g. JAR's don't come with a build-in mechanism.

@cmelchior
Copy link
Contributor

We have seen reports in Realm Java indicating corrupt files in combination with asset files. We cannot definitely point to assetfiles being the root cause of this, but it would make sense to support an overload that accept a checksum of the file, so we can ensure that the file shipped is actually also the file copied from the APK, something like Configuration.assetFile(fileName: String, sha256checkSum: String? = null)

@tinoue
Copy link

tinoue commented Apr 8, 2023

It the issue still open ?
I haven't tested by myself yet, but it seems like the following document support bundled (asset) realm data."
https://www.mongodb.com/docs/realm/sdk/kotlin/realm-database/realm-files/bundle-a-realm/

@rorbech
Copy link
Contributor

rorbech commented Apr 11, 2023

@tinoue Yes, the issue is still open and is currently been worked on. The convention around placing the files in the source project is a bit tricky due to varying conventions on the various platforms, so there is unfortunately no ETA.

The linked docs seems off. I will file an issue to fix that, thanks.

@sync-by-unito sync-by-unito bot changed the title Add support for RealmConfiguration.assetFile() Add support for RealmConfiguration.initialRealmFile() May 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants