tags:

views:

103

answers:

3

What is a good database with support for C? I want a database that can persist changes when the program is closing and retrieve them when the user starts up the program. I was thinking maybe like SQLite or Berkeley DB. Some documentation would be great too. I just need a database with a library for C. It will be used locally to store simple information like a key (of char *) that corresponds with a value (of char *)

+3  A: 

PostgreSQL comes with libpq, which is a C library.

Yan Cheng CHEOK
You want to use a full-blown, enterprise-capable database to store program settings? That's a bit overkill, isn't it?
Robert Harvey
Yea, i love postgres too, but def. overkill for settings...
W_P
+5  A: 

For embedded data, try SQLite.

Although if it's just program settings for a single instance of the program, an XML file might be your best bet. There are lots of freely-available XML parsers for C.

Robert Harvey
A: 

Depending on what you need to store and retrieve as well as all other criteria one would use to select one of these options.

You can read and write to and from a file.

You can use the databases you mention - They both have excellent documentation and are free.

You can use any open source or commercial RDBMS - Excellent docs also. (MySql PostgresSQL, Firebird, etc ... for open source) (Oracle, DB/2, Sybase, SQLServer, etc ...)

Romain Hippeau
The question states that the OP wants to store program settings.
Robert Harvey
@Robert Harvey - I want a database that can persist changes when the program is closing and retrieve them when the user starts up the program implies to me that he wants to read some info when the program is starting and write it before it closes. I also read it as persisting data while running - I'll ask
Romain Hippeau