Skip to content

I can't replace certain columns #1739

@Gustazx

Description

@Gustazx

In sequelize raw queries, if i want to do a replace in certain columns that no needs quotes, i can't disable this quotes to use in my context

Example:

const query = "SELECT * FROM users u ORDER BY :field :order"


const items = await this.sequelize.query(query, {
    replacements: {
    field: "u.name",
    order: "ASC",
    }
});

the query would be SELECT * FROM users u ORDER BY N'u.name' N'ASC'
causing a syntax error in database

Is there a method that i can disable this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions