SQLite.swift icon indicating copy to clipboard operation
SQLite.swift copied to clipboard

near "?": syntax error in "INSERT INTO "users" (?) VALUES (?)"

Open meili19916 opened this issue 1 year ago • 4 comments

When I run the demo to insert a email,it failed with error "near "?": syntax error in "INSERT INTO "users" (?) VALUES (?)""; Xcode 16.1 iphone os 17.3.1 pod 'SQLite.swift', '~> 0.14.0'

meili19916 avatar Dec 02 '24 07:12 meili19916

i hav the same problem and this was tricky. Expression from swift will have Expression(value:VARX) and SQLite Expression will have Expression(VARX) i have first my code changed from swift 15 to swift 16 and have added value: to the function. then i have added for SQLite the prefix SQLIte. so was my code SQLite.Expression(value:VARX). this gives no error on compile but the SQLite function read only unnamed parameters and so hi has not initalized the name of my column. that gives exact the same output like yours. the right version is : SQLite.Expression(VARX)

soognarf avatar Jan 16 '25 13:01 soognarf

I have the same issue. Did you have to revert to Xcode 15 to resolve it?

bradleyboyd avatar Feb 01 '25 23:02 bradleyboyd

no, i am on Xcode 16

soognarf avatar Feb 03 '25 06:02 soognarf

Oh, I get it now. You changed 'Expression(VARX)' to 'SQLite.Expression(VARX)'. Thanks!

bradleyboyd avatar Feb 06 '25 00:02 bradleyboyd