Feat: AsyncLocalStorage for schema changing
This commit is contained in:
parent
e6059be8d2
commit
351d170c31
5 changed files with 55 additions and 27 deletions
12
lib/async-storage.js
Normal file
12
lib/async-storage.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const { AsyncLocalStorage } = require('async_hooks')
|
||||
const asyncLocalStorage = new AsyncLocalStorage()
|
||||
|
||||
const defaultStore = (a = null) => {
|
||||
const store = new Map()
|
||||
store.set('schema', 'public')
|
||||
store.set('defaultSchema', 'ERROR_SCHEMA')
|
||||
if (a) store.set('a', 'a')
|
||||
return store
|
||||
}
|
||||
|
||||
module.exports = { asyncLocalStorage, defaultStore }
|
||||
Loading…
Add table
Add a link
Reference in a new issue