Skip to content

Sequelize generates incorrect SQL #7163

@bz0z

Description

@bz0z

Hello. I have a problem in postgresql using ILIKE

    db.companies.findAll({where: {name: {$iLike: "%"+name+"%"}}}).then(function(companies) {
        callback(companies)
    }).catch(function(error) {
        throw error;
    })

generates this SQL

SELECT "id", "name", "city", "sphere", "founder", "accountType", "visible", "createdAt", "updatedAt" FROM "companies" AS "companies" WHERE "companies"."name" '%z%';

and I always get an error because of ILIKE: Possibly unhandled SequelizeDatabaseError: error: schema "companies" does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions