Skip to content

Commit

Permalink
Merge pull request #178 from haslersn/enhancement/document-execute-pp…
Browse files Browse the repository at this point in the history
…-diff

Document the difference between `execute` and `++`
  • Loading branch information
aminroosta committed Jul 6, 2019
2 parents 936cd0c + 6113aa9 commit 39d1191
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ ps >> [&](int a,int b){ ... };
// after a successfull execution the statment can be executed again, but the bound values are resetted.
// If you dont need the returned values you can execute it like this
ps.execute();
ps++; // Does reset the bound values
// or like this
ps++;
ps.execute(); // Does NOT reset the bound values, but we can reset them manually:
ps.reset();
// To disable the execution of a statment when it goes out of scope and wasn't used
ps.used(true); // or false if you want it to execute even if it was used
Expand All @@ -132,7 +133,7 @@ auto ps = db << "insert into complex_table_with_lots_of_indices values (?,?,?)";
int i = 0;
while( i < 100000 ){
ps << long_list[i++] << long_list[i++] << long_list[i++];
ps++;
ps++; // Equal to: ps.execute(); ps.reset();
}
```

Expand Down

0 comments on commit 39d1191

Please sign in to comment.