e42.uk Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

Database API Choices

Database API Choices

What choices do I have for simple access to my database... something that is quick, easy and the same. As expected most database APIs do roughly the same thing and I have worked with many. Examples always seem so nice and simple but then when it comes time to implement something they become too verbose and clumbersome... especially in a language that does not have a GC or some other form of automatic memory management.

Rust seems to be a favourite recently and interacting with a database through an ORM is certainly something one should try... if only to decide how much they despise the contortions required when something just a little out of the ordinary is required.

Basic Operations

Consider the Sqlite3 API (or at least a generalisation) required for most operations.

sqlite3_open();
sqlite3_close();
sqlite3_prepare();
sqlite3_bind();
sqlite3_step();
sqlite3_column();
sqlite3_reset();
sqlite3_finalize();
sqlite3_close();

References

Old Stuff

The Borland Database Engine (BDE) is really quite nice as it was integrated into the Delphi programming language / IDE and C++Builder both of which have a place in my heart as I used them a lot in the past.

Newer Stuff

ODBC (Open Database Connectivity) is a technology introduced in 1992, the history is interesting and worth a read if you have a little time.

C++ / C / Tcl / Java

The SQLite3 Examples in Tcl are really cute and I find myself wanting to learn Tcl... unfortunately that is not an option and I am limited to C and/or C++.

Simple C++ Database API

I quite like the interface, seems familiar but perhaps a little verbose.

dbicpp

Very simple and quick API, like the API used in Delphi and C++Builder. Uses CMake and is quite large... I just want a nice, simple, wrapper around the C API.

db_conn

Nice and small. Great example... could this be the one?

SOCI

Quite Big, uses Boost (fine but again, big). Not so sure I like the API... does not have a pleasing aesthetic.

Quick Links: Techie Stuff | General | Personal | Quick Reference