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'm pretty happy with this library. It got me to learn about ASIO coroutines in C++. The tutorials here would make a great introduction for a general C++ coroutine class. I'd suggest pushing the tutorials more in the README.
Thanks for your feedback! Writing these took me more than I anticipated, so this is comforting to hear. Mentioning #166 to update the readme by linking the tutorials.
The first link you provide is very similar to the client-side SQL formatting we already have here - from the SO answer, it looks like no compile-time checks are happening there. Docs about client-side SQL formatting:
I'm not sure how viable is to syntax check everything client-side, since this would require a SQL parser in the client, and MySQL's grammar is massive (and it actually changes from version to version). It's probably more viable to go with an approach like the one in the 2nd link. This feature is out of scope for this library, but I could think of writing something like it as a different library (although not right now as I'm with other stuff). It can be implemented on top of format_context and format_sql_to.
I came across this library that does compile-type SQL syntax checking but it relies on its own connector library for connecting to various databases: https://github.com/rbock/sqlpp11
There's been a request to add async capability: rbock/sqlpp11#344
I'm wondering how hard it might be to write a connector implementation using Boost::MySQL.
That can be done, but the result will still be sync. As I see it, sqlpp11 is like an "interface", with individual connectors implementing that interface. If the interface is sync, even if individual connectors have async capabilities, the result will still be sync.
I think an async version of sqlpp11 would be useful. It's something I have in mind in the long run. I'm currently implementing a postgres equivalent of Boost.MySQL. With two async DB libraries, we could think of an interface that makes sense.
Activity
SpareSimian commentedon Feb 12, 2025
I'm pretty happy with this library. It got me to learn about ASIO coroutines in C++. The tutorials here would make a great introduction for a general C++ coroutine class. I'd suggest pushing the tutorials more in the README.
Is anyone using a C++ library to generate SQL statements? Something that will do a bit of SQL syntax checking in the compiler before it gets checked on the server at runtime. Some hints at candidates:
https://stackoverflow.com/questions/18346357/c-sql-query-building-library
https://www.reddit.com/r/cpp/comments/hxy27v/a_singleheader_library_for_build_sql_query_string/
https://github.com/six-ddc/sql-builder
anarthal commentedon Feb 12, 2025
Thanks for your feedback! Writing these took me more than I anticipated, so this is comforting to hear. Mentioning #166 to update the readme by linking the tutorials.
The first link you provide is very similar to the client-side SQL formatting we already have here - from the SO answer, it looks like no compile-time checks are happening there. Docs about client-side SQL formatting:
I'm not sure how viable is to syntax check everything client-side, since this would require a SQL parser in the client, and MySQL's grammar is massive (and it actually changes from version to version). It's probably more viable to go with an approach like the one in the 2nd link. This feature is out of scope for this library, but I could think of writing something like it as a different library (although not right now as I'm with other stuff). It can be implemented on top of
format_contextandformat_sql_to.SpareSimian commentedon Feb 12, 2025
I came across this library that does compile-type SQL syntax checking but it relies on its own connector library for connecting to various databases: https://github.com/rbock/sqlpp11
There's been a request to add async capability: rbock/sqlpp11#344
I'm wondering how hard it might be to write a connector implementation using Boost::MySQL.
anarthal commentedon Feb 13, 2025
That can be done, but the result will still be sync. As I see it, sqlpp11 is like an "interface", with individual connectors implementing that interface. If the interface is sync, even if individual connectors have async capabilities, the result will still be sync.
I think an async version of sqlpp11 would be useful. It's something I have in mind in the long run. I'm currently implementing a postgres equivalent of Boost.MySQL. With two async DB libraries, we could think of an interface that makes sense.
Riztazz commentedon Nov 15, 2025
Anyway to track the progress on the postgres equivalent?:P
Love the lib, thanks for it!
anarthal commentedon Nov 15, 2025
Actually yes :) https://github.com/anarthal/nativepg