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
Invalid SQL statements with Xcode 10.2 #888
Comments
I have the exact same problem with Xcode Version 10.2 (10E125) (not the beta normally) ! Do you have a workaround or a fix ? |
The best option in my opinion is to get rid altogether of the |
Note that this also silently breaks SqlLiteMigrationManager => Will always fall into the catch and report that no migration exists ... |
Here is a patch to apply if you have a pod install |
the simplest fix would be to just ignore any string after the first |
I tried your patch but now it started giving 148 errors similar to /Pods/SQLite.swift/Sources/SQLite/Typed/Operators.swift:471:12: Use of unresolved identifier 'infix' @christopheblin Could you please explain how you used the patch? The Patch did not work properly |
In folder where you cloned repo: All tests pass after patch applied |
Thanks, |
@stephencelis hello! Can you check this issue and linked pr? Any project with SQLite.swift will not work on new Xcode 10.2 without this fix. |
The symptom which lead me down this rabbit hole was first seeing was that it could not prepare a statement so: I agree with @chess92. My simple workaround for now this change in private func trimName(_ function: String) -> String {
return function.components(separatedBy: "(").first ?? function
}
func infix<T>(_ lhs: Expressible, _ rhs: Expressible, wrap: Bool = true, function: String = #function) -> Expression<T> {
return trimName(function).infix(lhs, rhs, wrap: wrap)
}
func wrap<T>(_ expression: Expressible, function: String = #function) -> Expression<T> {
return trimName(function).wrap(expression)
}
func wrap<T>(_ expressions: [Expressible], function: String = #function) -> Expression<T> {
return trimName(function).wrap(", ".join(expressions))
} |
@timshadel |
Hello |
@karishmapujara We have PR with the fix. Waiting for @stephencelis to review and merge |
Right??!! Exactly why I was waiting for a real fix. 😃 It looks like #891 handles this nicely with several enums and removes the |
Referenced SQLite.swift issue **[stephencelis#888](stephencelis#888
See SQLite.swift issues on GitHub: - stephencelis/SQLite.swift#894 - stephencelis/SQLite.swift#888
Build Information
General guidelines
In Xcode 10.2 beta 4 the macro
#function
shows a different behaviour. As SQLite.swift relies on#function
in different subroutines for the composition of SQLite queries, several bugs linked to invalid SQLite statements seem to be introduced.I have just run the SQLite.swift tests with Xcode 10.2 beta 4 and there are several failures linked to this issue.
An example as follows:
In the following helper function (Helpers.swift line 107):
when called from
static func count(_ star: Star) -> Expression<UnderlyingType>
the value of
function
when running in Xcode 10.2 beta 4 iscount(_:)
instead ofcount
. This leads to invalid SQLite statements of the typeSELECT count(_:)(*) myTable
.The text was updated successfully, but these errors were encountered: