profile
viewpoint

Ask questionstypescript error with sequelize literal

Versions

  • sequelize: 5.8.9
  • sequelize-typescript: 1.0.0-beta.3
  • typescript: 3.3.3

I'm submitting a ... [ X ] bug report [ ] feature request

Trying to migrate from:

sequelize: 5.0.0-beta.12
sequelize-typescript: 0.6.9
typescript: 2.9.1

to:

sequelize: 5.8.9
sequelize-typescript: 1.0.0-beta.3
typescript: 3.3.3

This is no more working:

const aas = await A.findAll({
      where: Sequelize.literal(
        `id IN (
            SELECT "aaId"
            FROM "Pp"
            WHERE "ppId" = 10
            )
        `,
      ),
    });

The error I get:

Argument of type '{ where: Literal; }' is not assignable to parameter of type 'FindOptions'.
  Types of property 'where' are incompatible.
    Type 'Literal' is not assignable to type 'WhereAttributeHash | AndOperator | OrOperator | Where | undefined'.
      Type 'Literal' is not assignable to type 'WhereAttributeHash'.
        Index signature is missing in type 'Literal'.ts(2345)
RobinBuschmann/sequelize-typescript

Answer questions fareshan

https://github.com/sequelize/sequelize/issues/11080

useful!
source:https://uonfu.com/
Github User Rank List