Skip to content
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

Optional type #2

Open
shial4 opened this issue Sep 12, 2019 · 1 comment
Open

Optional type #2

shial4 opened this issue Sep 12, 2019 · 1 comment

Comments

@shial4
Copy link

shial4 commented Sep 12, 2019

I have model

final class Organization: PostgreSQLModel {
    var id: Int?
    var location: GeographicPoint2D?
}

However, I do receive error when passing KeyPath

Cannot convert value of type 'ReferenceWritableKeyPath<Organization, GeographicPoint2D?>' to expected argument type 'PostgreSQLDatabase.QueryField' (aka 'GenericSQLColumnIdentifier<GenericSQLTableIdentifier, GenericSQLIdentifier>')

.filterGeometryDistanceWithin(\Organization.location, searchLocation, distance).all()

It does work when I do it with force unwrap

.filterGeometryDistanceWithin(\Organization.location!, searchLocation, distance).all()
@rabc
Copy link

rabc commented Dec 9, 2019

I had the exact same error, you can see my solution here: #1

Looks like the owner of this project is not actively looking it anymore :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants