Comments (2)
哦,我只看了mysql的源码部分,以为没有实现prepare stmt。
多谢,明白了。
from drogon.
prepare stmt是在底层自动进行的,分情况:
- 对postgreSQL来说,只要使用了绑定参数,底层就自动使用prepare stmt,并且相同的sql不会重复prepare;因为使用Mapper处理ORM对象时都是使用绑定参数的,所以Mapper接口的底层自然也是使用prepare stmt的。
使用prepare stmt的具体实现在这一部分:
https://github.com/an-tao/drogon/blob/dc4f8aac380586bd3e6e0002359125883021b738/orm_lib/src/postgresql_impl/PgConnection.cc#L204 - 对mysql来说,它的异步接口对绑定参数支持的都不太友好,我记得我使用过程中遇到了困难,最后放弃了,所以mysql的所有sql都是独立发送query,没用prepare。如果你有解决方案,欢迎提供建议或者PR。
- 对sqlite3来说,都是使用prepare stmt的。
from drogon.
Related Issues (20)
- cmake compile with -fPIC error?
- where to find config.h HOT 1
- drogon hides the system sigint signal handler function? HOT 1
- drogon transform header to lower case?
- 从curl换到drogon post请求出bug? HOT 2
- Expose more ways to obtain information about requests
- WebSockets not forwarded HOT 2
- How would I serve up a directory listing? HOT 1
- Use async callbacks for custom error handler
- 我有一个反向代理服务, 今天打开了"drogon::plugin::Hodor" 这个插件, 似乎这个插件不工作
- jsonc support HOT 4
- `drogon::app().forward(...)` does not perform URL escaping
- registerPostHandlingAdvice on OPTION request HOT 5
- 内存泄漏 HOT 2
- forward cant works HOT 1
- Hodor plugin add exempt IPs HOT 1
- gcc 14.1 HOT 1
- Let drogon_ctl generate systemd unit file
- drogon_ctl create model treats charvar[] (arrays) as std::string. HOT 2
- Provide capability to serve files without extension HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drogon.