egg-sequelize-autotrx
Advanced tools
Comparing version 0.0.23 to 1.0.0
@@ -0,0 +0,0 @@ module.exports = app => { |
@@ -0,0 +0,0 @@ module.exports = (options, app) => async (ctx, next) => { |
{ | ||
"name": "egg-sequelize-autotrx", | ||
"version": "0.0.23", | ||
"version": "1.0.0", | ||
"description": "Auto transaction based on cls-hooked for egg-sequelize plugin", | ||
@@ -5,0 +5,0 @@ "eggPlugin": { |
@@ -93,10 +93,7 @@ # egg-sequelize-autotrx | ||
// config.xx.js | ||
const mySequelize1 = require('sequelize') | ||
const mySequelize2 = require('sequelize') | ||
const clsNamespace1 = require('cls-hooked').createNamespace('your-namespace1') | ||
const clsNamespace2 = require('cls-hooked').createNamespace('your-namespace2') | ||
const mySequelize = require('sequelize') | ||
const clsNamespace = require('cls-hooked').createNamespace('your-namespace') | ||
// create multiple namespaces for multiple customized sequelize | ||
mySequelize1.useCLS(clsNamespace1) | ||
mySequelize2.useCLS(clsNamespace2) | ||
mySequelize.useCLS(clsNamespace) | ||
@@ -108,4 +105,4 @@ module.exports = appInfo => { | ||
config.sequelize = { | ||
Sequelize: mySequelize, | ||
datasources: [{ | ||
Sequelize: mySequelize1, | ||
delegate: 'model1', | ||
@@ -115,3 +112,2 @@ dialect: 'mysql' | ||
}, { | ||
Sequelize: mySequelize2, | ||
delegate: 'model2', | ||
@@ -118,0 +114,0 @@ dialect: 'mysql' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12671
1
181