I am trying to make the following call:
UPDATE MyTable SET path = ? WHERE instr(title, ?) AND start - ? < 60
However I have not been able to use instr with GRDB.
_ = try dbQueue?.write { db in
try MyTable
.filter(Column("start") > date - 60)
.filter(title.contains(Column("title")))
.updateAll(db,
Column("path").set(to: path)
)
}
How can I do this correctly? Could I also run a raw query instead? How can I fill the ? with my variables if using a raw query?
GRDB does not ship with built-in support for the
instrfunction. You can define it in your code:See the How do I print a request as SQL? faq in order to control the SQL generated by GRDB.