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(sequelize): add sequelize repository support #119

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
{name: 'ci-cd'},
{name: 'repository'},
{name: 'entity'},
{name: 'sequelize'},
],

appendBranchNameToCommitMessage: false,
Expand Down
6 changes: 3 additions & 3 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Path to sources
sonar.sources=src

# ignoring transaction repository as the duplication of the code is
# a compulsion in it, It's currently deprecated and will be completely removed in future releases.
sonar.exclusions=src/__tests__/**,src/repositories/default-transaction-soft-crud.repository.base.ts
# Ignoring transaction and sequelize soft crud repository as the duplication of the code is a compulsion in it.
# These will be removed in a next major release in favor of universal mixin usage.
sonar.exclusions=src/__tests__/**,src/repositories/default-transaction-soft-crud.repository.base.ts,src/repositories/sequelize.soft-crud.repository.base.ts
#sonar.inclusions=

# Path to tests
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The package exports following classes and mixins:
3. [SoftCrudRepositoryMixin](#softcrudrepositorymixin) - Mixin accepting any respository that extends the DefaultCrudRepository to add soft delete functionality to. Can be used as a wrapper for `DefaultCrudRepository`, `DefaultTransactionalRepository` etc.
4. [SoftDeleteEntityMixin](#softdeleteentitymixin)
5. [DefaultTransactionSoftCrudRepository](#defaulttransactionsoftcrudrepository-deprecated) (Deprecated) - Class providing soft crud capabilitiies. To be used in place of `DefaultTransactionalRepository`.
6. [SequelizeSoftCrudRepository](#sequelizesoftcrudrepository) - Class providing soft crud capabilitiies for [loopback4-sequelize](https://www.npmjs.com/package/loopback4-sequelize) package. To be used in place of `SequelizeCrudRepository`.

Following are more details on the usage of above artifcats:

Expand All @@ -42,6 +43,11 @@ The column names needed to be there in DB within that table are - 'deleted', 'de
If you are using auto-migration of loopback 4, then, you may not need to do anything specific to add this column.
If not, then please add these columns to the DB table.

### SequelizeSoftCrudRepository

An abstract base class providing soft delete capabilities for projects using [loopback4-sequelize](https://www.npmjs.com/package/loopback4-sequelize) package.
All the other workings are similar to [SoftCrudRepository](#softcrudrepository).

### SoftCrudRepository

An abstract base class for all repositories which require soft delete feature.
Expand Down
Loading