Lazarus

Programming => Databases => Topic started by: WalterK on November 01, 2011, 12:23:51 am

Title: simple record-based database - did I re-invent the wheel?
Post by: WalterK on November 01, 2011, 12:23:51 am
Hi,

Mostly as an execise to keep my brain from atrophying, I put together a simple file-backed database which uses full records rather than fields, stored in a linear fashion and searched via binary chop.  (It lacks full functionality as of now.)  It will serve my purposes for various small projects, and is simple in a way *I* can understand - this may be because I've never dug into the Delphi/fpc database system.

Does this kind of thing already exist in fpc?  If so, what components?
If not, ought I make the functions 'standard' so I could roll this into play with everything else?  Would anyone else use it, or is it of no advantage?

Thanks.

Walter
Title: Re: simple record-based database - did I re-invent the wheel?
Post by: Leledumbo on November 01, 2011, 07:31:25 am
Quote
Does this kind of thing already exist in fpc?  If so, what components?
Here (http://wiki.lazarus.freepascal.org/Databases#Supported_databases) you could see the list, those which don't need client lib and server are what you're looking for (the in-memory ones usually could be dumped to/restored from files as well). There's also ZMSQL (http://wiki.lazarus.freepascal.org/ZMSQL).
Title: Re: simple record-based database - did I re-invent the wheel?
Post by: BigChimp on November 01, 2011, 11:51:36 am
In addition to what Leledumbo said, I think using sqlite could be a good idea: very cross-platform, good performance, easy installation, easy use if you're familiar with SQL.

Otherwise sdfdataset could be used or ZMSQL which stores data as CSV/semicolon separated values.

But exercises against brain atrophy are always good - if you need more, could I suggest you take over/help maintenance of the TDBF components (see eg http://sourceforge.net/projects/tdbf/forums/forum/107245 (http://sourceforge.net/projects/tdbf/forums/forum/107245) as the maintainer, Micha Nelissen, has abandoned it?
It is included in a default FPC install but there are some bugs in it (see bugtracker)...

Just a thought  :D
TinyPortal © 2005-2018