sqlite的使用

# 与sequelize结合使用

  config.sequelize = {
    // dialect: 'sqlite', // mysql
    // storage: path.join(appInfo.baseDir, `db/${config.app.name}.db`), // 默认值 ':memory:'

    host: '127.0.0.1',
    port: 3306,
    username: 'xx',
    password: 'xxx',
    database: `${config.app.name}_dev`,
    dialectOptions: {
      charset: 'utf8mb4'
    },
    define: {
      freezeTableName: true,
      version: true
      // underscored: false
    },
    Sequelize: require('sequelize')
  }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
上次更新: 2022/04/15, 05:41:31
×