Sqlite.swift: TALLY.select(*).filter(DATE >= startDate)报错

Created on 26 Mar 2019  ·  4Comments  ·  Source: stephencelis/SQLite.swift

xcode10.2, filter内使用>=判断符,会导致

 try connection.check(sqlite3_prepare_v2(connection.handle, SQL, -1, &handle, nil))

返回报错信息
near ":_": syntax error

All 4 comments

Duplicate of #888

888 is closed, but I've pod updated, and I'm still getting this error, too.

My failing line of code:

try db.run(table.filter(timestamp < before).delete())

(where "db" is a Connection, "table" is a Table, "timestamp" is a Expression\, and "before" is a Date)

This generates the statement DELETE FROM "some_table" WHERE ("timestamp" <(_:_:) ?).

Apparently the Date gets encoded as (_:_:) ?

It turns out the podspec version has not been updated, so Cocoapods is downloading a stale version of the repo. I worked around this by linking my Podfile directly to the repo.

You use like:
let query = table.filter(0...10 ~= value)
to filter out value between 0 and 10

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DiamondYuan picture DiamondYuan  ·  3Comments

Mina-R-Meshriky picture Mina-R-Meshriky  ·  6Comments

pgawlowski picture pgawlowski  ·  6Comments

justdan0227 picture justdan0227  ·  7Comments

askari01 picture askari01  ·  7Comments