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

Feedback #140

Open
anarthal opened this issue Apr 5, 2023 · 4 comments
Open

Feedback #140

anarthal opened this issue Apr 5, 2023 · 4 comments

Comments

@anarthal
Copy link
Collaborator

anarthal commented Apr 5, 2023

  • Are you finding any problems when using the library?
  • Is there any use case that we're not covering as you'd like?
  • Do you have any feature suggestion?
  • Are you successfully using the library and you'd like to share your use case with us?

Comment on this issue if you'd like to share any feedback.

@SpareSimian
Copy link

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
Copy link
Collaborator Author

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.

@SpareSimian
Copy link

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
Copy link
Collaborator Author

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.

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