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

realm.deleteRealm #169

Merged
merged 16 commits into from Jan 13, 2022
Merged

realm.deleteRealm #169

merged 16 commits into from Jan 13, 2022

Conversation

desistefanova
Copy link
Contributor

@desistefanova desistefanova commented Jan 12, 2022

Realm deleteRealm implemented - fixes #49

@cla-bot cla-bot bot added the cla: yes label Jan 12, 2022
@desistefanova desistefanova linked an issue Jan 12, 2022 that may be closed by this pull request
Copy link
Member

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the Core API instead of manually deleting the files. It's not a problem when you're the only process accessing a file, but it becomes an issue with multiprocess access.

@desistefanova
Copy link
Contributor Author

This should use the Core API instead of manually deleting the files. It's not a problem when you're the only process accessing a file, but it becomes an issue with multiprocess access.

@nirinchev yes, we have delete_files function in the core API for .Net, but I couldn't find such method exposed in realm.h for Dart sdk. That's why we decided to implement it in Dart.

@blagoev
Copy link
Contributor

blagoev commented Jan 12, 2022

Indeed we are referencing core v11.8 which does not have the delete files api. It was only recently added in realm/realm-core@9913f7d
Let me update core to newer version and we can change the implementation to use that instead of Dart APIs. I think we will support only sync delete with the core version.

@desistefanova
Copy link
Contributor Author

Indeed we are referencing core v11.8 which does not have the delete files api. It was only recently added in realm/realm-core@9913f7d Let me update core to newer version and we can change the implementation to use that instead of Dart APIs. I think we will support only sync delete with the core version.

It will be great. I will change it as soon as we have the new version.

@blagoev
Copy link
Contributor

blagoev commented Jan 12, 2022

@desistefanova ok I merged #170 which includes realm_delete_files C API

@desistefanova desistefanova changed the title deleteRealm & deleteRealmSync realm.deleteRealm Jan 13, 2022
lib/src/realm_class.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide resolved
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide resolved
test/realm_test.dart Outdated Show resolved Hide resolved
test/realm_test.dart Outdated Show resolved Hide resolved
test/realm_test.dart Outdated Show resolved Hide resolved
test/realm_test.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide resolved
@desistefanova
Copy link
Contributor Author

Indeed we are referencing core v11.8 which does not have the delete files api. It was only recently added in realm/realm-core@9913f7d Let me update core to newer version and we can change the implementation to use that instead of Dart APIs. I think we will support only sync delete with the core version.

It will be great. I will change it as soon as we have the new version.

Done.

desistefanova and others added 4 commits January 13, 2022 11:41
Co-authored-by: blagoev <lubo@blagoev.com>
Co-authored-by: blagoev <lubo@blagoev.com>
deleteRealm return type changed from bool to void
@desistefanova desistefanova marked this pull request as ready for review January 13, 2022 12:59
Copy link
Contributor

@blagoev blagoev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 with small change requested

lib/src/native/realm_core.dart Outdated Show resolved Hide resolved
Co-authored-by: blagoev <lubo@blagoev.com>
@desistefanova
Copy link
Contributor Author

This should use the Core API instead of manually deleting the files. It's not a problem when you're the only process accessing a file, but it becomes an issue with multiprocess access.

@nirinchev we've changed the implementation to use realm_delete_files C API. So it is done.

@desistefanova desistefanova merged commit 6157c98 into master Jan 13, 2022
@desistefanova desistefanova deleted the realm.deleteRealm branch January 13, 2022 22:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Realm.deleteRealm
4 participants