Prepared Statements in libdbi

二次信任 提交于 2019-12-10 16:25:33

问题


I want to use libdbi to make an application database-agnostic. I would like to use prepared statements. How can I use prepared statements with libdbi? All the examples I saw use normal select bla from blub where foo; statements and use escaping functions provided by libdbi for input escaping.

If it is not possible to do this in libdbi, can you recommend another db-abstraction-library that can do that or explain why such a feature does not make sense?


回答1:


Unfortunately, libdbi does NOT support prepared statements. Source: libdbi documentation at http://libdbi.sourceforge.net/docs/programmers-guide Also read this thread at syslog-ng: http://marc.info/?t=129555478500003

If you don't mind C++, SOCI might be an alternative for you: http://soci.sourceforge.net



来源:https://stackoverflow.com/questions/11267397/prepared-statements-in-libdbi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!