-
Notifications
You must be signed in to change notification settings - Fork 346
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
[SQLite] Should running a parameterized update statement with execute be possible? #596
Comments
Thanks for the question. As of today, the That said, your gut has a point: It should probably be allowed to do |
I'd be glad to help out with that, but then you need to tell me where I should intervene. Based on the error message I guess that a new overload of If you think that even after revealing my ignorance I can be useful, let me know how and I will put that together. Then hopefully the next time I will need less hand-holding... ;) |
You pretty much answered your questions yourself :-) I would try to add another overload for |
Will give it a try sir! :) |
I have the patch ready, but I seem to be unable to push my changes: do not have permissions. How is one supposed to submit a PR here?
Update
|
You need to :
The location of git credentials varies on different system, but on Fedora Linux they are in In
In
|
@MeanSquaredError thanks for the detailed guide, really appreciated. I am used to the [dev branch from main] --> [do your changes in dev branch] --> [create PR from dev branch] --> [merge dev branch back to main branch] approach, but one learns something new every day. Now I do not have to wonder why are there so many forks of this project. :-) |
Indeed the way most people commit changes to the upstream/original project is by making changes to a separate local branch, then pushing that branch to their own fork and then creating a PR to merge their branch to the upstream. This approach would work in your case too, but for brevity I omitted the step where you create a separate branch for your changes. The critical thing which caused the push error in your case is that you are only allowed to push to github repositories for which you have the necessary permissions. In most cases these are your own projects (either the ones that you created or your forks of 3rd party projects) for which you have the corresponding permissions and your have configured the auth credentials in your git client. That is why you can push to your forks of 3rd party projects (in this case sqlpp11) as long as you get your auth credentials and configure them in your git client. However you cannot push to the 3rd party projct (in this case sqlpp11), because your auth credentials don't have the permissions for that. |
I get the concept, it is the "own fork" part that was new to me as it feels a bit unnecessary. Limiting the main branch to not accept direct commits (to outsiders at least) should be enough because that way the only way in to main is via a PR. But I see now that this is the GitHub way of doing things so learning and adapting... After you spelled it out for me it was a rather straightforward process. I hope the PR looks ok. :) |
I have the following update statement:
Running this query like this:
db(u_stmnt);
works perfect.However, using
db.execute(u_stmnt);
results in compile time
error: no matching function for call to ‘serialize(const sqlpp::prepared_update_t<sqlpp::sqlite3::connection_base, sqlpp::statement_t<void, sqlpp::update_t, sqlpp::single_table_t<void, MyTable>, sqlpp::update_list_t<void, sqlpp::assignment_t<sqlpp::column_t<MyTable, MyTable_::field_checksum>, sqlpp::parameter_t<sqlpp::unsigned_integral, sqlpp::column_t<MyTable, MyTable_::field_checksum> > > >, sqlpp::where_t<void, sqlpp::binary_expression_t<sqlpp::verbatim_t<sqlpp::unsigned_integral>, sqlpp::op::equal_to, sqlpp::parameter_t<sqlpp::unsigned_integral, sqlpp::alias::i_t> > > > >&, sqlpp::sqlite3::connection_base::_context_t&)’
Now, as I am running an update I really do not need any kind of result back so my gut tells me that this should work with
execute()
, but it does not.Is my gut talking nonsense or - against all odds - it does have a point?
The text was updated successfully, but these errors were encountered: