0.0.312 • Published 6 months ago

sequelize-transactional-typescript v0.0.312

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Sequelize Transactional Decorator

  • this is simple package that provide you with a roubust out of the box @Transactional for sequelize

how to use it:

  • frist you have to call initializeSequelizeWithTransactionalContext in your bootstrap flow.

NOTE: for nestjs, it must be called before nest app creation.

await initializeSequelizeWithTransactionalContext();
  • for nestjs: import SequelizeModule and add it to your AppModule Like the following:
    @Module({
      imports: [SequelizeModule.forRoot(<SequelizeModuleOptions>)],
    })
    export class AppModule {}

Usage Example:

  @Transactional({
    isolationLevel: 'READ COMMITTED',
  })
  async createPost(fails: boolean = false): Promise<Post> {
    return await this.testTransactionIsolated(fails);
  }

0.0.312

6 months ago

0.0.311

6 months ago

0.0.310

6 months ago

0.0.309

6 months ago

0.0.308

6 months ago

0.0.307

6 months ago

0.0.306

6 months ago

0.0.305

6 months ago

0.0.304

6 months ago

0.0.303

6 months ago

0.0.302

6 months ago

0.0.301

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago