0

I am using SQLite.swift library.

I have defined a expression:

let id = Expression<Int64>("id")

I have a variable:

let num: Int = 1

Then, in update statement I do filtering:

let users = Table("User")
// compiler error: // Binary operator '==' cannot be applied to operands of type 'Expression<Int64>' and 'Int'
users.filter(id == num) 

I get compiler error showing in above comment. I understand what the error is saying, but how to get rid of it? According to SQLite.swift library document, the library should be smart enough to map Int with Expression Int64.

Leem
  • 17,220
  • 36
  • 109
  • 159

1 Answers1

0

You will get rid of this error by using the Int64 type (or Int) for both the id expression and the num variable.

Gwendal Roué
  • 3,949
  • 15
  • 34