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

Implemented setting fifoFilesFallbackPath in configuration #284

Merged
merged 10 commits into from
Mar 7, 2022

Conversation

desistefanova
Copy link
Contributor

Support custom FIFO files paths. Fixes #93

@cla-bot cla-bot bot added the cla: yes label Mar 2, 2022
if (fifoFilesFallbackPath?.isNotEmpty ?? false) {
this.fifoFilesFallbackPath = fifoFilesFallbackPath!;
}

if (readOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not part of this PR, but I noticed this check. Should we not just set property regardless?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FIFO path is empty by default in C-API. It doesn't need to be set. This is some kind as a small optimization.
If you mean ReadOnly, it is a mode and the value is enum value. I would like to keep the default enum value of schema mode, which is currently "Automatic". But you are right it is not visible here, you can see it inside _realmLib.realm_config_set_in_memory.

Copy link
Contributor

@nielsenko nielsenko Mar 2, 2022

Choose a reason for hiding this comment

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

Not sure I follow

Copy link
Contributor

Choose a reason for hiding this comment

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

there is sense in doing that. The least we call core the better. I think this is should be the case for all optional properties.

@coveralls
Copy link

coveralls commented Mar 2, 2022

Pull Request Test Coverage Report for Build 1945713141

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.366%

Totals Coverage Status
Change from base Build 1945569410: 0.0%
Covered Lines: 380
Relevant Lines: 407

💛 - Coveralls

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
CHANGELOG.md Outdated Show resolved Hide resolved
lib/src/configuration.dart Outdated Show resolved Hide resolved
: _schema = RealmSchema(schemaObjects),
_handle = realmCore.createConfig() {
schemaVersion = 0;
path = defaultPath;

if (fifoFilesFallbackPath?.isNotEmpty ?? false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could check for null only instead. if you really want to check for empty string then we need to throw a meaningful exception. I suggest checking for null only here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if (fifoFilesFallbackPath?.isNotEmpty ?? false) {
this.fifoFilesFallbackPath = fifoFilesFallbackPath!;
}

if (readOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

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

there is sense in doing that. The least we call core the better. I think this is should be the case for all optional properties.

desistefanova and others added 3 commits March 7, 2022 12:50
Co-authored-by: blagoev <lubo@blagoev.com>
Co-authored-by: blagoev <lubo@blagoev.com>
lib/src/configuration.dart Outdated Show resolved Hide resolved
Co-authored-by: blagoev <lubo@blagoev.com>
@desistefanova desistefanova merged commit 37a632c into master Mar 7, 2022
@desistefanova desistefanova deleted the config_fifo_files branch March 7, 2022 13:51
@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.

Config: Support custom FIFO files paths
4 participants