-
Notifications
You must be signed in to change notification settings - Fork 345
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
Async support work around. #344
Comments
Hi, thanks for the feedback. Please let me know how this works out for you! Something like the following should work % typos: ::sqlpp::postgresql::connection::_serializer_context context;
std::string serialized_query = serialize(query, context).str(); |
^ This works for me. Are there any plans on adding async support to the library? If I wanted to contribute something like that any starting point you recommend? |
Thanks for letting me know! As of now, I have no plans for adding async support, and I know very little about coroutines. That being said, I believe the best place to start would be the connector libraries and/or the |
BTW, How to do the opposite, i.e. parse returned results into C++ objects ? (I did a quick search, but did not mange to find, as unfamiliar with the codebase ) |
Not sure I understand the question? The returned results are C++ objects. Each row has data members that have the name of the returned columns, e.g.
|
having this : ::sqlpp::postgresql::connection::_serializer_context context;
std::string serialized_query = serialize(query, context).str(); DSL expression can be serialized into text to be sent (asynchronously) to the DB. Once the reply is received (in text) - it has to be converted to the C++ objects according to DDL. I believe sqlpp does this under the hood. The question is how to do this explicitly (if I do wish to send query and receive results by myself and use sqlpp to serialize and desirialize ) |
I see. This very much depends on the individual database and the type of the query. The most prominent result type is an array of char*. These are then parsed. See for instance Note that these functions are implementation details. While currently stable, they might change any time. |
Hey! Thanks for this library.
I am trying to figure out how to setup sqlpp11 to work with boost asio in an asynchronous manner.
I think for the first pass, I just want to retrieve the string sqlpp11 is passing into the connector libraries and then directly use it to talk to psql.
Is there a way to get at the sql string that the
db
object passes to the connector?The text was updated successfully, but these errors were encountered: