Recent

Author Topic: simple record-based database - did I re-invent the wheel?  (Read 2976 times)

WalterK

  • New Member
  • *
  • Posts: 48
simple record-based database - did I re-invent the wheel?
« 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

Leledumbo

  • Hero Member
  • *****
  • Posts: 8266
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: simple record-based database - did I re-invent the wheel?
« Reply #1 on: November 01, 2011, 07:31:25 am »
Quote
Does this kind of thing already exist in fpc?  If so, what components?
Here 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.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: simple record-based database - did I re-invent the wheel?
« Reply #2 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 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
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018