Reputation: 581
Is there a data structure which gives you functions of a database (like insert, update, delete etc)? For example:
I know that with a hashtable you can do this (ex: uthash library). But as far as I know updating one column element only is not easy in a hash table.
Upvotes: 4
Views: 1886
Reputation: 10242
Use C structs to represent rows of data and then trees (or maybe hashes) for indexes. There are a lot of little problems you will need to solve, specially in order to make all the operations efficient, but this forms the basis for an in-memory table.
For simple things, a tree structure may be enough.
Upvotes: 0
Reputation: 43558
Look at sqlite. Rather than a relational database system, it is essentially a connectionless, file-based database library that supports SQL. You link your program against it and it provides functions to perform SQL queries over data files.
Upvotes: 2