Skip to content

Commit 424c611

Browse files
authored
feat(sequelize): add sequelize repository support (#119)
Export `SequelizeSoftCrudRepository` providing soft-delete capabilities with sequelize as underlying repository GH-118
1 parent aa622ab commit 424c611

File tree

8 files changed

+3201
-12666
lines changed

8 files changed

+3201
-12666
lines changed

.cz-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
{name: 'ci-cd'},
3131
{name: 'repository'},
3232
{name: 'entity'},
33+
{name: 'sequelize'},
3334
],
3435

3536
appendBranchNameToCommitMessage: false,

.sonarcloud.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Path to sources
22
sonar.sources=src
33

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

99
# Path to tests

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ The package exports following classes and mixins:
3131
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.
3232
4. [SoftDeleteEntityMixin](#softdeleteentitymixin)
3333
5. [DefaultTransactionSoftCrudRepository](#defaulttransactionsoftcrudrepository-deprecated) (Deprecated) - Class providing soft crud capabilitiies. To be used in place of `DefaultTransactionalRepository`.
34+
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`.
3435

3536
Following are more details on the usage of above artifcats:
3637

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

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

4753
An abstract base class for all repositories which require soft delete feature.

0 commit comments

Comments
 (0)