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

Use keys in dictionary if value for IN operator #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeffdgr8
Copy link

@jeffdgr8 jeffdgr8 commented May 26, 2018

This is the way the default NSSQLiteStoreType behaves. Iterating over an NSDictionary iterates over its keys as well.

Currently, if a dictionary is used as the value for IN in a predicate, it creates SQL: SELECT ... FROM ... WHERE (... IN ?); and produces the error could not prepare statement: near "?": syntax error.

With these changes, the SQL is: SELECT ... FROM ... WHERE (... IN (?, ?, ...));, where the bindings for ?, ?, ... are the dictionary's keys.

This is the way the default NSSQLiteStoreType behaves. Iterating over an NSDictionary iterates over its keys as well.
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

Successfully merging this pull request may close these issues.

1 participant