Feat: make compute schema middleware for 'db' changing
This commit is contained in:
parent
7bbf2829de
commit
cbf0165893
2 changed files with 15 additions and 0 deletions
12
lib/compute-schema.js
Normal file
12
lib/compute-schema.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const { asyncLocalStorage } = require('./async-storage')
|
||||
|
||||
const computeSchema = (req, res, next) => {
|
||||
const store = new Map()
|
||||
store.set('schema', 'public')
|
||||
store.set('defaultSchema', 'ERROR_SCHEMA')
|
||||
asyncLocalStorage.run(store, () => {
|
||||
next()
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = computeSchema
|
||||
Loading…
Add table
Add a link
Reference in a new issue