Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryBuilder - whereNotColumn failing #2436

Open
DaveO-Home opened this issue May 31, 2023 · 0 comments
Open

QueryBuilder - whereNotColumn failing #2436

DaveO-Home opened this issue May 31, 2023 · 0 comments
Labels

Comments

@DaveO-Home
Copy link

Using: objection@3.0.1 with knex

Model:

class User extends Model {
  static get tableName() {
    return "users";
  }

  static get idColumn() {
     return "id";
  }

  static get jsonSchema() {
      return {
        type: "object",
        required: ["name", "password"],

        properties: {
          id: { type: "integer" },
          password: { type: "string", minLength: 10, maxLength: 255 },
          name: { type: "string", minLength: 1, maxLength: 255 },
          "last_login": { type: "integer" },
        },
      }
    }
}

Query:
query.whereNotColumn({ password: ws.id });

DBError: select `users`.* from `users` where not `password` = `MDIwNTAxMDEtMDkwOC00MzA4LTg4MDgtMDUwMTA3MDkwMTAz` - SQLITE_ERROR: no such column: MDIwNTAxMDEtMDkwOC00MzA4LTg4MDgtMDUwMTA3MDkwMTAz

Notice the tic's around the value, if I remove them and run in the cli the query works. Looks like the tic marks should not be generated for the value.

@lehni lehni added the bug label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants