sequelize.js - Sequelize Snowflake (v7 alpha) TypeError when syncing a model - Stack Overflow

I'm getting a Type error when trying to sync a model with @sequelizesnowflake ( "@sequelize

I'm getting a Type error when trying to sync a model with @sequelize/snowflake ( "@sequelize/core": "^7.0.0-alpha.42", "@sequelize/snowflake": "^7.0.0-alpha.45"). I'm aware that the Snowflake dialect is community maintained. I am using Fastify.

Model:

@Table({
    tableName: "EXAMPLE",
    timestamps: false,
    underscored: true,
})
export class Example extends Model<
    InferAttributes<Example>,
    InferCreationAttributes<Example>
> {
    @Attribute(DataTypes.STRING)
    @PrimaryKey
    @ColumnName("TEST")
    declare test: string;
    ...
TypeError: Expected type to be a string, a DataType class, or a DataType instance, but got STRING {
  usageContext: undefined,
  options: { length: undefined, binary: false }
}.
    at normalizeDataType (/app/node_modules/@sequelize/core/src/abstract-dialect/data-types-utils.ts:47:11)
    at Sequelize.normalizeDataType (/app/node_modules/@sequelize/core/src/sequelize-typescript.ts:1212:12)
    at Sequelize.validateValue (/app/node_modules/@sequelize/core/src/sequelize-typescript.ts:1200:17)
at SnowflakeQueryGenerator.escape (/app/node_modules/@sequelize/snowflake/node_modules/@sequelize/core/src/abstract-dialect/query-generator-typescript.ts:867:20)
    at SnowflakeQueryGenerator.tableExistsQuery (/app/node_modules/@sequelize/snowflake/node_modules/@sequelize/core/src/abstract-dialect/query-generator-typescript.ts:918:118)
    at SnowflakeQueryInterface.tableExists (/app/node_modules/@sequelize/snowflake/node_modules/@sequelize/core/src/abstract-dialect/query-interface-typescript.ts:332:37)
    at Function.sync (/app/node_modules/@sequelize/core/src/model.js:873:47)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async <anonymous> (/app/src/plugins/sequelize.ts:20:3)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744808552a4594925.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信