How to store dynamic data (unknown number of fields) to a file?

I need to store some data in a file. FOR THE MOMENT each record (data set) consists in:

  • a string (variable length),
  • an array of integers (variable length),
  • an array of bytes (variable length),
  • some integer values.

It wouldn't be difficult at all to save all these stuff in a binary file. However, I know for sure that (unfortunately) my data format will change in time, and I want to have the possibility to add more fields to each "record". So, obviously my file format cannot be fixed. I suppose that the best solution will be to save my data in (DB) table but I don't want to mess up with the big guns (SQL, ADO, BDE, Nexus...). I need a rudimentary library (if possible single PAS file) that can do that. Since the purpose of this is rather storing data than working with data, can it be done without a DB table?

Requirements for this library:

  • it needs to easily support more than 1 million rows
  • really lightweight
  • single PAS file if possible
  • MANDATORY: easy to install in a new machine (together with the project in which it compiles)
  • MANDATORY: in order to use it I don't need to redistribute anything
  • MANDATORY: in order to use it the user doesn't have to install/setup stuff
  • can be freeware/shareware
  • it doesn't have to support SQL queries or similar advanced stuff

I use D7

5
задан Ultralisk 11 February 2011 в 18:14
поделиться