Skip to content

Invalid syntax for undefined value #8476

Closed

Description

@andrew-aladev

Hello. I've find small but important issue.

Please open lib/dialects/abstract/query-generator.js

return this._joinKeyValue(key, this.escape(value, field), value === null ? this.OperatorMap[Op.is] : this.OperatorMap[Op.eq], options.prefix);

I am doing select query:

.findOne({
  where: {
    a: undefined
  }
})

It will generate:

SELECT ... WHERE "table_name"."a" = NULL LIMIT 1

It is wrong, we should use is operator for NULL. I will provide a pull request soon.

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