Skip to content

I can't replace certain columns #1739

Open

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 ?

Activity

  1. Joaopaulovendramini commented on Jan 30, 2025

    @Joaopaulovendramini

    I need to concatenate to solve this problem; I believe a method for this would be convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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