鍍金池/ 問答/數(shù)據(jù)庫  網(wǎng)絡(luò)安全  HTML/ think.js 使用 think-sequelize 插件報錯

think.js 使用 think-sequelize 插件報錯

DESC

think-sequelize

想用 Mssql 數(shù)據(jù)庫,使用 think-sequelize 插件,已根據(jù) 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: {
    // 單據(jù)模塊配置的數(shù)據(jù)庫設(shè)置
    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 版出現(xiàn)。

回答
編輯回答
執(zhí)念
2017年8月20日 02:03
編輯回答
懶洋洋

沒用過think-sequelize這個玩意兒,7個start,0個fork,沒有issue,。
我直接用的sequelize,你第一個不是錯誤,只是使用操作符的警告,詳見官方文檔,http://docs.sequelizejs.com/m...,配置operatorsAliases就行了。第二問題不了解。

2017年3月5日 01:46