Database Independent Abstraction Layer for C (libdbi) implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl.
Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework.
Here are some key features of "Database Independent Abstraction Layer for C":
Your programs don't need to deal with the arbitrary interfaces and oddities of each database library. libdbi handles all the details for you, you just tell it what you want the database to do.
Since database code written with libdbi is not tied to one specific database server, you can effortlessly switch databases or give your users the option to specify their own database settings.
With ample documentation describing libdbi and its well thought out object-oriented design, programming with libdbi should be less painful than programming with native database libraries. And you only need to learn it once instead of learning each database library's syntax.
Accommodates coder apathy:
libdbi is written to do The Right Thing(tm), not just some quick hack that does the job in a half-assed fashion. This saves tons of your $100/hour time from debugging, so that you can mess around having fun during the hours that clients are paying you to debug. It also strives to reduce the worldwide crisis of carpal tunnel syndrome, so it uses constructs such as this one to pack multiple function calls into one line, saving you the bother of typing more than you have to:
dbi_result_get_fields(result, "id.%i firstname.%s lastname.%s fractional_value.%f", &id, &firstname, &lastname, &floatval);
The dynamic linking used by libdbi allows for driver authors to license their drivers however they please - they are not restricted to the GPL or LGPL. Drivers are easy to write, and require no special installation.
Instead of checking every single database call for errors, libdbi gives programmers the option of registering an error handler callback, similar to a signal handler. Because we know you'll "forget" to check for errors otherwise :)
Spend your time writing clever code, not reinventing the wheel with your own single-use, #define-abusing, less featureful database interface.
libdbi implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl. Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework.
The libdbi-drivers project maintains drivers for libdbi. Drivers are distributed seperately from the library itself.
There are currently drivers for MySQL, PostgreSQL, SQLite, and mSQL. More are on the way.
What's New in This Release: [ read full changelog ]
· The library now supports multiple independent "instances", which permits programs to use several dlopen()ed modules which are linked against libdbi.
· Support for transactions and savepoints has been added, and drivers now receive additional hints to optimize sequential reads from result sets.