You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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 result_t template. You probably could add a yield function there?
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 )
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 include/sqlpp11/sqlite3/bind_result.h.
Note that these functions are implementation details. While currently stable, they might change any time.
Activity
rbock commentedon Jul 7, 2020
Hi, thanks for the feedback. Please let me know how this works out for you!
Something like the following should work % typos:
scmp197 commentedon Jul 7, 2020
^ This works for me. Are there any plans on adding async support to the library?
Especially with coroutines. That would be a cool feature.
If I wanted to contribute something like that any starting point you recommend?
rbock commentedon Jul 8, 2020
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
result_ttemplate. You probably could add ayieldfunction there?anton-potapov commentedon Sep 14, 2023
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 )
rbock commentedon Sep 15, 2023
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.
anton-potapov commentedon Sep 15, 2023
having this :
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 )
rbock commentedon Sep 16, 2023
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
include/sqlpp11/sqlite3/bind_result.h.Note that these functions are implementation details. While currently stable, they might change any time.