http://www.perlmonks.org?node_id=224680

gmpassos has asked for the wisdom of the Perl Monks concerning the following question:

I was looking for the best DBD option for flat files, or any way that don't need to install a DB server, just the DBD module, but all need to be PORTABLE (at least fro Linux & Win32). I have tested some good modules:

1* DBD::SQLite

The idea is very good, have a good SQL syntax. But is very hard to compile on Win32, since DBI don't compile with MingW and SQLite only compile with MingW on Win32. To compile I got 2 Perl, 1 compiled with VC++ and other with MingW, and after this group the DBI and DBD::SQLite in one version. I tried ExtUtils::FakeConfig to avoid a Perl compiled with MingW, but doesn't work with this module!

But this module doesn't work very well, at least on Win32. Is very easy to get errors, even with codes used in the install tests. One big bug is the reuse of existing db files! If you create a program that creates the db files and use it, it's ok, but if you open an existing file not!

2* DBD::Sprite

Seems to be a DBD::CSV improved. But it doesn't work very well on Win32 too! It has the same problem to reopen db files! If this bugs were fixed it can be a very good candidate!

3* DBD::CSV

What I like in this is the stability and is portable, since the concept is simple! But it isn't fast, specially for big files. If some one has more experience with this, please, comment where and when you used it!

4* DBD::RAM

I like very much this! It's portable and stable too, and work very well with different types of files! But it doesn't install with the last version of DBD::CSV (that it uses), I get an old version of DBD::CSV to make it work! If some one has more experience with this, please comment too!

About DBD::RAM I have a question, a catalog() method (Continuous file access), really don't load all the db file in the memory?! Or it only kip saving the file?!

All this modules have very good ideas, but they need to be more stables, specially on Win32!

If someone know other good DBD modules, or any way to have a database with SQL syntax on Perl, that don't depends on 3rd programs, and portable, please, comment!

Or if someone know a very small and portable SQL server, please, send it! We can embed it inside a XS, like DBD::SQLite.

Graciliano M. P.
"The creativity is the expression of the liberty".

Originally posted as a Categorized Question.

  • Comment on What's the best option on DBD for flat files or non server db?

Replies are listed 'Best First'.
Re: What's the best option on DBD for flat files or non server db?
by Jenda (Abbot) on Jan 06, 2003 at 20:13 UTC

    I did not have any problems compiling DBD::SQLite with MSVC6.0 under Win32 at all (ActivePerl 5.6.1 build 631), all tests passed, everything I tried worked fine. If you happen to use ActivePerl (or something compatible) you can install the module with PPM from http://Jenda.Krynicky.cz/perl

    I am not using it in production code though now. I don't have any use for it currently.

    Could you show me some code that errored out for you? Hope you sent a bugreport to the authors!

    Jenda

      Thanks for the PPM. ;-P
      But your version is the 0.15, and I had problems to compile the last, 0.23.

      I will make some tests on this version! And I already sent a bug report for the author, this is a good module, can't be crashed for Win32 since it has everything to be portable!

      Note: Do you have the 0.15 source files? I can't find on CPAN!

      Update: I found a repository with all the versions of DBD::SQLite at http://cpan.azc.uam.mx/modules/by-category/07_Database_Interfaces/DBD/
      I tested the version 0.21 and works for tests and compilation on Win32! ;-P

      Graciliano M. P.
      "The creativity is the expression of the liberty".

Re: What's the best option on DBD for flat files or non server db?
by Juerd (Abbot) on Jan 06, 2003 at 22:02 UTC
    I'd choose DBD::SQLite. It's extremely fast and has all important features. I'm a Linux user, and it works perfectly here, but some Windows users told me they use the PPM without problems, so you could try that.