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

Binding fields (data to query) iteratively #22

Open
herhor67 opened this issue Mar 14, 2023 · 1 comment
Open

Binding fields (data to query) iteratively #22

herhor67 opened this issue Mar 14, 2023 · 1 comment

Comments

@herhor67
Copy link

herhor67 commented Mar 14, 2023

Hello,
I have a statement for batch insert, so I used bind_fields to put the values from my buffer into the query, instead of using one giant tuple.
However, it seems that qtl::execute clears binders (or sth else is happening), because the query always executes empty.
How can I omit that behavior? Or maybe I completely misunderstood the goal of bind_fields?
Is there another, proper way for such binding, that I somehow didn't notice?
Edit: It seems like I should use bind_params instead of bind_fields... Though the question still remains.

Also, it is impossible to call qtl::execute whithout any data, so how to do that? Is passing an empty tuple<>() alright? It would be great if there was a predefined type for that, or possibly another overload.

@herhor67 herhor67 changed the title Binding fields (data to query) externally Binding fields (data to query) iteratively Mar 14, 2023
@znone
Copy link
Owner

znone commented May 2, 2023

bind_params is used to bind query parameters, bind_fields is used to receive query result fields. If you has not any parameters, should use simple_execute.

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

No branches or pull requests

2 participants