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

feat(datastore): implement custom primary key functionality #1517

Closed

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Apr 7, 2022

Issue #, if available:

#1426

Description of changes:

Create native objects presenting model indexes and let native storage engine create data tables with expected indexes.

  • This PR includes code style fix
  • Actual functionality changes and implement are included in

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@HuiSF HuiSF requested a review from a team as a code owner April 7, 2022 22:01
@HuiSF HuiSF marked this pull request as draft April 7, 2022 22:52
@HuiSF HuiSF force-pushed the feat/custom-pk-model-index branch from fde239a to b968355 Compare April 11, 2022 17:22
@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2022

Codecov Report

Attention: Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.

Project coverage is 36.34%. Comparing base (8a85689) to head (2e289b3).

Files with missing lines Patch % Lines
...mplify_core/lib/src/types/models/model_schema.dart 0.00% 8 Missing ⚠️
...ore/lib/src/types/query/query_field_operators.dart 0.00% 8 Missing ⚠️
...kages/amplify_core/lib/src/types/models/model.dart 0.00% 7 Missing ⚠️
...lify_core/lib/src/types/query/query_predicate.dart 0.00% 7 Missing ⚠️
...re/lib/src/types/query/query_model_identifier.dart 0.00% 3 Missing ⚠️
.../lib/src/types/models/model_schema_definition.dart 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (8a85689) and HEAD (2e289b3). Click for more details.

HEAD has 11 uploads less than BASE
Flag BASE (8a85689) HEAD (2e289b3)
android-unit-tests 6 0
ios-unit-tests 5 0
Additional details and impacted files
@@                Coverage Diff                 @@
##           feat/custom-pk    #1517      +/-   ##
==================================================
- Coverage           46.32%   36.34%   -9.99%     
==================================================
  Files                 263      244      -19     
  Lines               10229     8191    -2038     
==================================================
- Hits                 4739     2977    -1762     
+ Misses               5490     5214     -276     
Flag Coverage Δ
android-unit-tests ?
flutter-unit-tests 36.34% <0.00%> (-0.15%) ⬇️
ios-unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../lib/src/types/models/model_schema_definition.dart 0.00% <0.00%> (ø)
...re/lib/src/types/query/query_model_identifier.dart 0.00% <0.00%> (ø)
...kages/amplify_core/lib/src/types/models/model.dart 0.00% <0.00%> (ø)
...lify_core/lib/src/types/query/query_predicate.dart 3.12% <0.00%> (-0.39%) ⬇️
...mplify_core/lib/src/types/models/model_schema.dart 0.00% <0.00%> (ø)
...ore/lib/src/types/query/query_field_operators.dart 1.14% <0.00%> (-0.12%) ⬇️

... and 20 files with indirect coverage changes

@HuiSF HuiSF marked this pull request as ready for review April 11, 2022 18:03
Copy link
Contributor

@dnys1 dnys1 left a comment

Choose a reason for hiding this comment

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

Looks good overall. Maybe I missed it - are there unit tests for this?

@@ -19,661 +19,664 @@ import com.amplifyframework.core.model.*
import com.amplifyframework.core.model.temporal.Temporal

val postSchema = ModelSchema.builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do any of these need to be updated with indexes? Or should we add one with indexes?

Copy link
Member Author

Choose a reason for hiding this comment

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

The test model Post has a SDI defined, the index info has been added to this testing model and its schema, see line 24 - 26. And it's asserted by unit tests. iOS impl. has similar changes too.

@HuiSF HuiSF marked this pull request as draft April 25, 2022 17:38
@HuiSF HuiSF changed the title feat(datastore): forwarding model index information into native implementation feat(datastore): implement custom primary key functionality Apr 25, 2022
@HuiSF HuiSF closed this May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants