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

Add support for WITHOUT ROWID tables #365

Merged
merged 6 commits into from
Jul 30, 2020

Conversation

John-He-928
Copy link
Contributor

See #358

Added withoutRowid parameter to @Entity annotation, which appends WITHOUT ROWID to the CREATE TABLE statement if set to true.

Simple test cases included.

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Merging #365 into develop will decrease coverage by 0.06%.
The diff coverage is 73.68%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #365      +/-   ##
===========================================
- Coverage    81.51%   81.44%   -0.07%     
===========================================
  Files           59       59              
  Lines         1509     1525      +16     
===========================================
+ Hits          1230     1242      +12     
- Misses         279      283       +4     
Flag Coverage Δ
#floor 81.44% <73.68%> (-0.07%) ⬇️
#floor_generator 81.01% <73.68%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
...or/lib/processor/error/entity_processor_error.dart 3.57% <0.00%> (-0.43%) ⬇️
floor_generator/lib/value_object/entity.dart 96.22% <83.33%> (+0.22%) ⬆️
...loor_generator/lib/processor/entity_processor.dart 76.31% <90.00%> (+1.31%) ⬆️

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 3efee4d...e29a9de. Read the comment docs.

@@ -100,7 +105,8 @@ class Entity extends Queryable {
primaryKey.hashCode ^
foreignKeys.hashCode ^
indices.hashCode ^
constructor.hashCode;
constructor.hashCode ^
withoutRowid.hashCode;

@override
String toString() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please also change the toString method.

@mqus
Copy link
Collaborator

mqus commented Jul 8, 2020

So first of all, thank you for your contribution and sorry for not looking at it sooner. I have mainly two minor issues with your code: The first is the toString method (see the comment above) and the second is the following:
I'm wondering if it would make sense to add a check for points 1 and 3 in the sqlite docs , meaning that WITHOUT ROWID tables should have a primary key that is not auto-incremented.

Apart from that, I'm pretty happy with your changes. But @vitusortner should probably take a look.

@mqus mqus requested a review from vitusortner July 8, 2020 09:23
@John-He-928
Copy link
Contributor Author

@mqus Thank you for the review. I will update the code :)

@vitusortner
Copy link
Collaborator

Thanks for your contribution and thanks for your patience!

@vitusortner vitusortner merged commit 54a5cf2 into pinchbv:develop Jul 30, 2020
@vitusortner vitusortner linked an issue Jul 30, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

WITHOUT ROWID table support
3 participants