异步c++ mysql 连接器

发布于 2024-11-02 04:01:18 字数 553 浏览 4 评论 0原文

谷歌搜索关于mysql的异步/非阻塞连接器我基本上去了这篇文章

然而,已经过去了两年了,现在追踪细雨中发生的事情有点令人困惑。 libdrizzle 在某些时候是一个单独的依赖项,但他们决定将其与项目的其余部分合并。 C++ 异步数据库访问还有其他选项吗?

我一直在查看OTLODBOpenDBX< /a>,但它们似乎都是同步的(需要单独的线程进行非阻塞操作)

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 been looking at OTL, ODB and OpenDBX, but they all seem to be synchronous (require a separate thread for non-blocking operation)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我最亲爱的 2024-11-09 04:01:18

我也有同样的愿望,但得出的结论是不支持。即使使用 MySQL C API,您也可以使用低级函数来异步发出查询并等待响应,但您永远无法获得完整的异步结果收集——从结果的第一部分开始,您总是会处于阻塞状态。直到最后才回来。

我没有直接的经验,但我读到 Postgres 确实支持完全异步(至少在 C API 中)。

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).

烟酉 2024-11-09 04:01:18

我曾经在自己的项目中使用 MySAC 。虽然有点过时,但效果很好。我只是引用他们网站上的描述:

MySAC 是一个库,提供向 MySQL 数据库发出异步请求的机制。

如果您使用 libuv,也许您会对 https://github.com/huxingyi/myc 感兴趣。这是我编写的纯 C mysql 连接器,您可以实现自己的网络层,或者仅在示例文件夹中使用基于 libuv 实现的 uvmyc

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文