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

Change ForeignKeyAction to enum in the generator #359

Merged

Conversation

mqus
Copy link
Collaborator

@mqus mqus commented Jun 14, 2020

This changes ForeignKeyAction to be an enum instead of a string. This allows us to be more strict when processing the annotation as well as be more confident when dealing with annotations.

This is a preparation for the sqlanalyzer, to avoid matching strings when converting floor entities to moor/sqlparser tables.

@mqus mqus added the refactoring Improvement without changing functionality label Jun 14, 2020
@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #359 (a25a0e3) into develop (c5925af) will increase coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #359      +/-   ##
===========================================
+ Coverage    82.83%   83.05%   +0.22%     
===========================================
  Files           68       68              
  Lines         1660     1682      +22     
===========================================
+ Hits          1375     1397      +22     
  Misses         285      285              
Flag Coverage Δ
floor 83.05% <100.00%> (+0.22%) ⬆️
floor_generator 82.90% <100.00%> (+0.25%) ⬆️

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

Impacted Files Coverage Δ
...ator/lib/misc/extension/dart_object_extension.dart 100.00% <100.00%> (ø)
...b/misc/extension/foreign_key_action_extension.dart 100.00% <100.00%> (ø)
...loor_generator/lib/processor/entity_processor.dart 80.57% <100.00%> (+0.42%) ⬆️
...or/lib/processor/error/entity_processor_error.dart 15.62% <100.00%> (+12.05%) ⬆️
...ator/lib/processor/insertion_method_processor.dart 89.18% <100.00%> (+0.95%) ⬆️
...nerator/lib/processor/update_method_processor.dart 83.33% <100.00%> (+1.51%) ⬆️
floor_generator/lib/value_object/foreign_key.dart 66.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5925af...a25a0e3. Read the comment docs.

@mqus mqus requested a review from vitusortner June 14, 2020 14:06
@mqus mqus mentioned this pull request Jun 15, 2020
23 tasks
@mqus
Copy link
Collaborator Author

mqus commented Jun 16, 2020

I put the extension on annotations.ForeignKeyAction in the extensions folder (mainly because there is nothing else left in the file) and let value_object/foreign_key.dart re-export annotations.ForeignKeyAction for easy use in the writer.

mqus added a commit to mqus/floor that referenced this pull request Jun 20, 2020
@mqus mqus requested a review from vitusortner July 25, 2020 08:46
vitusortner
vitusortner previously approved these changes Aug 1, 2020
Copy link
Collaborator

@vitusortner vitusortner left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for making our codebase better 🙌

@mqus mqus force-pushed the refactor/change-to-foreignkeyaction-enum branch from 50855a3 to c5ebdf9 Compare August 21, 2020 22:23
…-foreignkeyaction-enum

# Conflicts:
#	floor_generator/lib/misc/extension/dart_object_extension.dart
#	floor_generator/lib/processor/entity_processor.dart
@vitusortner
Copy link
Collaborator

@mqus I'll look into getting this one merged if you don't mind?

@vitusortner vitusortner changed the title change ForeignKeyAction to enum in the generator Change ForeignKeyAction to enum in the generator Nov 22, 2020
@vitusortner vitusortner merged commit 1a49c0f into pinchbv:develop Nov 22, 2020
@mqus
Copy link
Collaborator Author

mqus commented Nov 23, 2020

Thank you!

vitusortner added a commit that referenced this pull request Dec 19, 2020
* Change ForeignKeyAction to enum in the generator (#359)

* Added support for WITH statements for DatabaseViews (#443)

* Documentation update on DateTimeConverter sample (#442)

* Make foreign key mapping null safe

Co-authored-by: mqus <8398165+mqus@users.noreply.github.com>
Co-authored-by: themadmrj <themadmrj@users.noreply.github.com>
Co-authored-by: Cássio Seffrin <cassioseffrin@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improvement without changing functionality
Development

Successfully merging this pull request may close these issues.

2 participants