Skip to content

feat: huge refactor on persistent apis#70

Merged
kiaking merged 6 commits intomasterfrom
persist-api-refactor
May 31, 2021
Merged

feat: huge refactor on persistent apis#70
kiaking merged 6 commits intomasterfrom
persist-api-refactor

Conversation

@kiaking
Copy link
Copy Markdown
Member

@kiaking kiaking commented May 18, 2021

This PR adds many braking changes that refactors how persistent methods such as insert and update works.

Type of PR:

  • Bugfix
  • Feature
  • Refactor
  • Code style update
  • Build-related changes
  • Test
  • Documentation
  • Other, please describe:

Breaking changes:

  • No
  • Yes

Details

It contains following changes.

  • All persistent methods are now synchronous. Not async anymore.
  • All persistent methods returns either Model or Model[].
  • The save method is the only method that normalizes the given data. insert, fresh, update will not normalize data anymore.
  • Removing add, revise, replace method. Use insert, update, fresh instead.
  • the update method now only works with query constraints. userRepo.where('name', 'John').update({ name: 'Jane' }).

@kiaking kiaking added the enhancement New feature or request label May 18, 2021
@kiaking kiaking self-assigned this May 18, 2021
@kiaking kiaking force-pushed the persist-api-refactor branch from 45a860a to 0ebead6 Compare May 31, 2021 06:58
@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2021

Codecov Report

Merging #70 (0ebead6) into master (17d202d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #70   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         1157      1122   -35     
  Branches       163       157    -6     
=========================================
- Hits          1157      1122   -35     
Impacted Files Coverage Δ
src/schema/Schema.ts 100.00% <ø> (ø)
src/connection/Connection.ts 100.00% <100.00%> (ø)
src/interpreter/Interpreter.ts 100.00% <100.00%> (ø)
src/modules/Mutations.ts 100.00% <100.00%> (ø)
src/query/Query.ts 100.00% <100.00%> (ø)
src/repository/Repository.ts 100.00% <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 17d202d...0ebead6. Read the comment docs.

@kiaking kiaking merged commit fe25477 into master May 31, 2021
@kiaking kiaking deleted the persist-api-refactor branch May 31, 2021 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant