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

Avoid SKYReference in relational queries #135

Open
chpapa opened this issue Oct 11, 2017 · 0 comments
Open

Avoid SKYReference in relational queries #135

chpapa opened this issue Oct 11, 2017 · 0 comments

Comments

@chpapa
Copy link
Contributor

chpapa commented Oct 11, 2017

Chat with some team member, people keep asking why we need to do this:

SKYRecord *currentUser = [SKYContainer defaultContainer].auth.currentUser;
SKYReference *nameRef = [SKYReference referenceWithRecord:currentUser];

NSPredicate *accountPredicate = [NSPredicate predicateWithFormat:@"account = %@", nameRef];

instead of simply this:

SKYRecord *currentUser = [SKYContainer defaultContainer].auth.currentUser;
NSPredicate *accountPredicate = [NSPredicate predicateWithFormat:@"account = %@", currentUser];

I'm not sure if NSPredicate allow user to directly put an object there or not. So it maybe more like a swift only things, I don't know :(

If we can detect and support all of these, would be great:

  • SKYReference (for backward compatibility)
  • anything extended skygear.Record
  • a string, assume it is a ID

That will greatly enhance skygear iOS SDK usability.

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

No branches or pull requests

1 participant