If you opt to use Postgres as Datbase, It offers libpq - C Library, The industry excellent library.

libpq may be the C application programmer's interface to PostgreSQL. libpq is some library functions that permit client programs to pass through queries towards the PostgreSQL after sales server and also to get the outcomes of these queries.

Take a look at SQLAPI++. Mix-platform, mix-db and relatively simple to use and integrate.