Search code examples
sqlcdatabaseprepared-statementdatabase-abstraction

Prepared Statements in libdbi


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?


Solution

  • 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