Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

feat(transaction): add transaction support #22

Merged
merged 1 commit into from
Mar 3, 2023
Merged

feat(transaction): add transaction support #22

merged 1 commit into from
Mar 3, 2023

Conversation

shubhamp-sf
Copy link
Collaborator

@shubhamp-sf shubhamp-sf commented Mar 2, 2023

Description

  • Provides beginTransaction method to SequelizeCrudRepository with somewhat similar usage as loopback transactions.
  • It can have different isolation levels similar to loopback.
  • Timeout parameter support is not there in this PR.

Fixes #21

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested with postgresql and sqlite3 database.

  • Tested if retrieves model instance once transaction is committed.
  • Tested if it can rollback transaction.
  • Ensured that created transactions are isolated based on the isolation level passed.
  • Ensured local transactions. (i.e. It should not use transaction with another repository of different datasource).
  • Tested in a freshly created lb4 app https://github.com/shubhamp-sf/loopback4-sequelize-transaction-example

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Add usage details in README.md.

@shubhamp-sf shubhamp-sf force-pushed the GH-21 branch 2 times, most recently from e9716eb to be90da7 Compare March 3, 2023 08:10
provide beginTransaction method to SequelizeCrudRepository with somewhat similar usage as loopback

GH-21
@shubhamp-sf shubhamp-sf marked this pull request as ready for review March 3, 2023 08:18
@shubhamp-sf shubhamp-sf merged commit 331238d into master Mar 3, 2023
@sfdevops
Copy link
Contributor

sfdevops commented Mar 3, 2023

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@shubhamp-sf shubhamp-sf deleted the GH-21 branch March 3, 2023 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loopback4-sequelize should support transactions
2 participants