types / sequelize

The typings for https://github.com/sequelize/sequelize
63 stars 37 forks source link

Model.count: CountOptions has no attribute 'paranoid' #163

Open knrdl opened 6 years ago

knrdl commented 6 years ago

Currently the CountOptions look like this:

export interface CountOptions extends Logging, Transactionable, Filterable, Projectable {
    /**
     * Include options. See `find` for details
     */
    include?: Includeable[]

    /**
     * Apply COUNT(DISTINCT(col))
     */
    distinct?: boolean

    /**
     * GROUP BY in sql
     * Used in conjunction with `attributes`.
     * @see Projectable
     */
    group?: GroupOption
}

However there is no 'paranoid' attribute, but it exists in the implementation. Please add:

paranoid?: boolean

It's likely that other calls are affected, too.

Current workaround:

YourModel.count({paranoid: false} as any)

(Counts all rows, also the ones deleted in paranoid mode)

felixfbecker commented 6 years ago

Please add:

Just open a PR ;)

knrdl commented 6 years ago

Opened PR :)