think.js 使用 think-sequelize 插件报错
DESC
想用 Mssql 数据库,使用 think-sequelize 插件,已根据 How to Use 配置
ENV
OS Platform: win 10 pro 64x
Node.js Version: v9.1.0
ThinkJS Version: v3.0.0 / v3.2.3 typescript
code 1
//adapter
type: 'sequel',
common: {
logConnect: isDev,
logSql: isDev,
logger: (msg: string) => think.logger.info(msg)
},
sequel: {
// 单据模块配置的数据库设置
connectionString: 'mssql://user:psw@127.0.0.1/db',
prefix: '',
logConnect: false,
options: {
logging: false
}
// database: 'db',
// prefix: '',
// encoding: 'utf8',
// port: '1433',
// user: 'user',
// password: 'pwd',
// dateStrings: true,
// options: {
// host: '127.0.0.1',
// dialect: 'mssql',
// logging: false,
// define: {
// timestamps: false
// }
// }
}
error message 1
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules\sequelize\lib\sequelize.js:236:13
code 2
//model
import { think } from 'thinkjs'
export default class extends think.Sequel {
}
error message 2
think.Sequel 报错:类型“Think”上不存在属性“Sequel”
more description
第二个错只在 typescript 版出现。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
https://github.com/thinkjs/th...
作者解答了。
没用过think-sequelize这个玩意儿,7个start,0个fork,没有issue,。
我直接用的sequelize,你第一个不是错误,只是使用操作符的警告,详见官方文档,http://docs.sequelizejs.com/m...,配置operatorsAliases就行了。第二问题不了解。