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

Improvements for executing query and update. #714

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

Conversation

iwill
Copy link

@iwill iwill commented Nov 5, 2018

Improvements for executing query and update:

  1. sql supports parameter prefix ":" or "$" or "@" which supports by sqlite3;
  2. bind null if dictionaryArgs does not contain a key from pStmt;
  3. not to bind if pStmt does not contain a key of dictionaryArgs;

The 2 and 3 are useful when dictionaryArgs is a JSON object, which serialized from an Objective-C object. Some keys need not be stored into database, and some other keys are ignored since their values are nil.

With this commit, we donot need create another dictionary which must has the apropos key-values any more.

1. sql supports parameter prefix ":" or "$" or "@";
2. bind null if `dictionaryArgs` does not contain a key from `pStmt`;
3. not to bind if `pStmt` does not contain a key of `dictionaryArgs`;
@ccgus
Copy link
Owner

ccgus commented Nov 10, 2018

At first glance, this looks reasonable and tests pass. Let me look at it a bit more though before I make a commit.

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.

2 participants