Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add flexible schema mapping POC#3635

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
nirinchev wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromfeature/flexible-mapping-poc

Conversation

@nirinchev
Copy link
Member

@nirinchevnirinchev commentedJun 26, 2024
edited
Loading

Notes doc

TODO:
Must-have

  • (NI) Implement the RealmValue.As conversion
  • (LJ) Write the generated MyModel code by hand
  • (LJ) Write some tests that use MyModel and read/write data using the strongly-typed properties

Nice to have

  • (NI) Wire up notification mapping for properties and add some tests
  • (NI+LJ) Write the generator that emits the IDynamicObject implementation
    • Code generator
    • Fody weaver part (if we use .NET)
  • Add support for nested links (embedded document/dictionary - i.e. not links to another collection)
  • Add support for proxying list/dictionary (e.g. List instead of List)
  • Error handling/missing property strategies

@coveralls-official
Copy link

coveralls-officialbot commentedJun 26, 2024
edited
Loading

Pull Request Test Coverage Report forBuild 9681982895

Details

  • 5 of10(50.0%) changed or added relevant lines in1 file are covered.
  • 7 unchanged lines in1 file lost coverage.
  • Overall coverage decreased (-0.05%) to81.304%

Changes Missing CoverageCovered LinesChanged/Added Lines%
Realm/Realm/DatabaseTypes/RealmValue.cs51050.0%
Files with Coverage ReductionNew Missed Lines%
Realm/Realm/Handles/SessionHandle.cs784.55%
TotalsCoverage Status
Change from baseBuild 9661237267:-0.05%
Covered Lines:6838
Relevant Lines:8257

💛 -Coveralls

@coveralls-official
Copy link

coveralls-officialbot commentedJul 1, 2024
edited
Loading

Pull Request Test Coverage Report forBuild 9742975006

Details

  • 12 of15(80.0%) changed or added relevant lines in2 files are covered.
  • 7 unchanged lines in1 file lost coverage.
  • Overall coverage increased (+0.03%) to81.384%

Changes Missing CoverageCovered LinesChanged/Added Lines%
Realm/Realm/Extensions/CollectionExtensions.cs030.0%
Files with Coverage ReductionNew Missed Lines%
Realm/Realm/Handles/SessionHandle.cs784.55%
TotalsCoverage Status
Change from baseBuild 9661237267:0.03%
Covered Lines:6846
Relevant Lines:8262

💛 -Coveralls

Comment on lines +601 to +612
if (getValueLines.Length == 0)
{
getValueBody = @"throw new MissingMemberException($""The object does not have a gettable Realm property with name {propertyName}"");";
}
else
{
getValueBody = $@"return propertyName switch
{{
{getValueLines.Indent(trimNewLines: true)}
_ => throw new MissingMemberException($""The object does not have a gettable Realm property with name {{propertyName}}""),
}};";
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +617 to +629
if (setValueLines.Length == 0)
{
setValueBody = @"throw new MissingMemberException($""The object does not have a settable Realm property with name {propertyName}"");";
}
else
{
setValueBody = $@"switch (propertyName)
{{
{setValueLines.Indent(trimNewLines: true)}
default:
throw new MissingMemberException($""The object does not have a settable Realm property with name {{propertyName}}"");
}}";
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +640 to +651
if (getListValueLines.Length == 0)
{
getListValueBody = @"throw new MissingMemberException($""The object does not have a Realm list property with name {propertyName}"");";
}
else
{
getListValueBody = $@"return propertyName switch
{{
{getListValueLines.Indent(trimNewLines: true)}
_ => throw new MissingMemberException($""The object does not have a Realm list property with name {{propertyName}}""),
}};";
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +656 to +667
if (getSetValueLines.Length == 0)
{
getSetValueBody = @"throw new MissingMemberException($""The object does not have a Realm set property with name {propertyName}"");";
}
else
{
getSetValueBody = $@"return propertyName switch
{{
{getSetValueLines.Indent(trimNewLines: true)}
_ => throw new MissingMemberException($""The object does not have a Realm set property with name {{propertyName}}""),
}};";
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +672 to +683
if (getDictionaryValueLines.Length == 0)
{
getDictionaryValueBody = @"throw new MissingMemberException($""The object does not have a Realm dictionary property with name {propertyName}"");";
}
else
{
getDictionaryValueBody = $@"return propertyName switch
{{
{getDictionaryValueLines.Indent(trimNewLines: true)}
_ => throw new MissingMemberException($""The object does not have a Realm dictionary property with name {{propertyName}}""),
}};";
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +746 to +759
if (property.TypeInfo.IsBacklink)
{
getFieldString = "GetBacklinks";
}
else
{
getFieldString = property.TypeInfo.CollectionType switch
{
CollectionType.List => "GetListValue",
CollectionType.Set => "GetSetValue",
CollectionType.Dictionary => "GetDictionaryValue",
_ => throw new NotImplementedException(),
};
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
@coveralls-official
Copy link

Pull Request Test Coverage Report forBuild 9875518284

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 12 of15(80.0%) changed or added relevant lines in2 files are covered.
  • 7 unchanged lines in1 file lost coverage.
  • Overall coverage increased (+0.03%) to81.384%

Changes Missing CoverageCovered LinesChanged/Added Lines%
Realm/Realm/Extensions/CollectionExtensions.cs030.0%
Files with Coverage ReductionNew Missed Lines%
Realm/Realm/Handles/SessionHandle.cs784.55%
TotalsCoverage Status
Change from baseBuild 9661237267:0.03%
Covered Lines:6846
Relevant Lines:8262

💛 -Coveralls

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@nirinchevnirinchev

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@nirinchev

[8]ページ先頭

©2009-2025 Movatter.jp