SequelizeBeforeConnectHook interface
一个结构类型,表示类似Sequelize的实例,支持 beforeConnect 生命周期钩子。 这样可以避免对封装的硬依赖 sequelize ,同时还能提供类型安全。
属性
| before |
在每次新的数据库连接前,注册一个回调。 |
属性详细信息
beforeConnect
在每次新的数据库连接前,注册一个回调。
beforeConnect: (callback: (config: { password?: string, username?: string }) => Promise<void>) => void
属性值
(callback: (config: { password?: string, username?: string }) => Promise<void>) => void