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(core): add Collection.slice() method #4608

Merged
merged 13 commits into from Aug 11, 2023
Merged

feat(core): add Collection.slice() method #4608

merged 13 commits into from Aug 11, 2023

Conversation

rubiin
Copy link
Contributor

@rubiin rubiin commented Aug 10, 2023

Adds support for Collection.slice()

packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/Collection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/Collection.ts Outdated Show resolved Hide resolved
tests/EntityManager.mongo.test.ts Outdated Show resolved Hide resolved
@rubiin rubiin requested a review from B4nan August 10, 2023 15:56
docs/docs/collections.md Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Show resolved Hide resolved
packages/core/src/entity/Collection.ts Outdated Show resolved Hide resolved
tests/EntityManager.mongo.test.ts Outdated Show resolved Hide resolved
rubiin and others added 7 commits August 10, 2023 21:57
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (79af75c) 99.64% compared to head (400de2d) 99.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4608   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         215      215           
  Lines       14247    14261   +14     
  Branches     3389     3393    +4     
=======================================
+ Hits        14196    14210   +14     
  Misses         50       50           
  Partials        1        1           
Files Changed Coverage Δ
packages/seeder/src/SeedManager.ts 100.00% <ø> (ø)
packages/core/src/entity/ArrayCollection.ts 100.00% <100.00%> (ø)
packages/core/src/entity/Collection.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rubiin rubiin requested a review from B4nan August 10, 2023 17:28
@rubiin
Copy link
Contributor Author

rubiin commented Aug 10, 2023

I was thinking instead of adding some minor collection methods in next pr, I will add them in here itself. What do you say

@B4nan
Copy link
Member

B4nan commented Aug 10, 2023

i'd say it should be separate PRs so it results in multiple items in the changelog

and please pay more attention to the comments, you still havent addressed all the missing spaces and wrong indents

@rubiin
Copy link
Contributor Author

rubiin commented Aug 10, 2023

I do have editorconfig extension setup and it should take care of the indentation afaik

Co-authored-by: Martin Adámek <banan23@gmail.com>
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
tests/EntityManager.mysql.test.ts Outdated Show resolved Hide resolved
Co-authored-by: Martin Adámek <banan23@gmail.com>
Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

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

all right, last few style changes. sorry for not having the linter set up properly, I hate to waste time (yours as well as mine) discussing style changes like this.

thanks!

.eslintrc.js Outdated Show resolved Hide resolved
packages/core/src/entity/ArrayCollection.ts Outdated Show resolved Hide resolved
tests/QueryBuilder.test.ts Outdated Show resolved Hide resolved
@rubiin
Copy link
Contributor Author

rubiin commented Aug 11, 2023

all right, last few style changes. sorry for not having the linter set up properly, I hate to waste time (yours as well as mine) discussing style changes like this.

thanks!

No worries man. With codebase of this size, these are bound to happen.

@B4nan B4nan changed the title feat(core): add Collection.slice() method feat(core): add Collection.slice() method Aug 11, 2023
@B4nan B4nan merged commit 7c99c37 into mikro-orm:master Aug 11, 2023
12 checks passed
@rubiin
Copy link
Contributor Author

rubiin commented Aug 11, 2023

Btw about the collections test, should I just add tests for a specific driver under features/Collection.ts or will the file hold for all drivers

@B4nan
Copy link
Member

B4nan commented Aug 11, 2023

We don't have to test this on all the drivers, in-memory sqlite is enough.

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.

None yet

2 participants