开发者

async c++ connector for mysql

googling about asynchronous /non-blocking connectors for mysql i went basically to this post

However, it's been 2 years and following whats happening on drizzle is a bit confusing at the moment. libdrizzle was a separate dependency at some point but they decided to merge it with the rest of the project. Are there other options for asynchronous database access from c++?

I've b开发者_JAVA技巧een looking at OTL, ODB and OpenDBX, but they all seem to be synchronous (require a separate thread for non-blocking operation)


I had the same desire and came to the conclusion that it's not supported. Even with the MySQL C API you can use the low-level functions to issue queries and wait for a response asynchronously, but you cannot ever get full asynchronous result collection--you always end up blocking from the time the first piece of the result is returned until the last.

I don't have direct experience with it, but I've read that Postgres does support full asynchrony (at least in the C API).


I used to used MySAC in my own project. It works well though is a little outdated. I just quote the description from their website:

MySAC is a library that provides mechanisms for making asynchronous request to MySQL database.

And maybe you will interested in https://github.com/huxingyi/myc if you use libuv. It's a pure c mysql connector wrote by me, you can implement your own network layer or just use the implemented libuv based uvmyc inside the example folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜